[feat] Mirror labels, processes, and note attachments in the shared library - #835
Merged
Conversation
…ibrary The shared library showed notes, knowledge, and assets, but not the labels and procedures inside shared notes, so a lab could not browse "which shared notes use this input" or "which shared procedures exist" without forking each note. - Add a local projection cache (.graphium-shared-projection.json) built from shared note bodies as the lexical lane reads them: labels via buildIndexEntry and procedures via buildProcessEntry (P-1; cross-note links dropped since they point at the author's local notes). Nothing is written back to the shared folder - Add Labels and Processes tabs that reuse LabelGalleryView and ProcessGalleryView over the projection; "open note" lands in the detail panel and "fork" reuses the shared-note fork - Show images and files embedded in shared notes as rows in the Assets tab (grouped by content hash, with their origin notes) with "open note" and "add to my materials"; give the Assets tab a Folder column and write folders into extra when sharing a material or reference - Parse each shared body once per read and hand it to both the index and the projection; serialize projection writes like process-index Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…irror-tabs # Conflicts: # manual/ja/storage-and-sync.md # manual/storage-and-sync.md # src/features/sharing/SharedLibraryView.stories.tsx
Contributor
Adversarial probesClick to expand probe results |
Contributor
Migration fixturesClick to expand migration results |
Contributor
Bench delta比較できませんでした: main に bench/baseline.json がありません(この PR がベースラインを初めて追加する場合、マージ後の PR から delta が出ます) delta 表を出すには、tracked の |
Contributor
Performance regressionClick to expand performance results |
9 tasks
Merged
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何を変えたか
共有ライブラリを個人側の左ナビの鏡にする続き(#825 / #828 / #831)。
LabelGalleryView/ProcessGalleryViewを流用)で見る。「ノートを開く」は Library の詳細パネル、「派生」は既存の共有ノート forkextra.blobs)を行として並べる(同じ内容は hash で 1 行に集約、出どころのノートを表示)。操作は「ノートを開く」と「自分の素材に取り込む」の 2 つだけ。素材タブにもフォルダ列を追加し、素材・URL の共有時に実効フォルダをextra.noteContextsに書くなぜ
「プロセスやラベルもチームで共有して、既存の実験をテンプレート的なナレッジとして蓄積したい」という要望への回答。共有ノートには手順もラベルも既に入っているので、新しい保存種別を作らず「共有側でそれを一覧として見る手段」を足した。
設計上の判断
.graphium-shared-projection.json、デスクトップのみ)。共有フォルダには一切書かない。[feat] Search and ground AI chat on shared library entries without forking #828 の語彙索引レーンが本文を読む経路に相乗りし、hash 単位で差分投影する。新しい読み取りは足さない(本文の JSON.parse は 1 回で索引と投影の両方に配る)buildProcessEntryの戻り値をそのまま保存。crossNoteLinksは共有元のローカルノート id を指すので落とすbuildIndexEntryの結果から取り出す(ノート一覧の索引と同じ抽出。二つの真実を作らない)versionと抽出ロジックの版(INDEX_SCHEMA_VERSION/PROCESS_INDEX_VERSION)を持ち、どちらかが違えば捨てて作り直す。書き込みは process-index と同じ直列キューSharedEntryType・Rust 許可リスト・各スキーマ版は変更なし。個人側の 2 ビューは prop 追加のみ(既定値で従来どおり)onForkNoteの throw で呼び出し側に伝わるようになった(プロセスタブの派生ボタンが失敗を表示できるように)変更点
shared-projection.ts(新規): 投影の型・純関数・永続化・ストア・擬似GraphiumIndex/ProcessIndexの組み立て・件数SharedLabelsTab.tsx(新規)、shared-blob-rows.ts(新規)、SharedLibraryTable.tsx(行をSharedAssetItemに一般化、blob 行、素材タブのフォルダ列)、SharedLibraryView.tsx(タブ・件数・配線)shared-library-sync.ts(1 回のパースを索引と投影に配る、投影の掃除)、shared-entry-source.ts(parseSharedBody)share-media.ts/share-reference.ts+ 呼び出し側(material-actions-menu/share-media-dialog/material-detail-header):extra.noteContextsnote-app.tsx:onImportBlobの配線、onForkNoteの失敗を throwレビュー
3 観点(正しさ・個人側との一貫性・性能)のレビューと各指摘への 3 名の反証を経て、確定 6 件を修正: blob 行のストーリー追加、fork 失敗の検知、本文の二重パース、投影ファイル書き込みの直列化、投影通知のバッチ化(200ms)、AI スイッチ OFF 時の説明文。
Test Plan
pnpm exec tsc --noEmitpnpm vitest run(main 取り込み後に 269 files / 3345 tests passed。新規: 投影・保存直列化・ラベルタブ・blob 行・表・fork 失敗の検知・share-media / share-reference の noteContexts)pnpm build/pnpm lint:deps(新規 violation なし)/pnpm manual:checkSharing/SharedLibraryView: ラベルタブ(種別チップ・ギャラリー)、プロセスタブ(一覧・手順フロー)、素材タブ(blob 行・出どころ・フォルダ列・取り込みボタンの無効化)🤖 Generated with Claude Code