[feat] Show and filter shared notes by the folder they were shared from - #831
Merged
Conversation
The shared library table had no folder column, so a teacher could not narrow a student's shared notes the way the note list allows. - Write the note's folders (noteContexts) into extra.noteContexts when a note is shared or re-shared; entries shared before this carry no folder metadata, so the shared store now keeps a derived-meta cache (localStorage, keyed by entry hash) filled in whenever a body is read for indexing, and getSharedNoteContexts is the single accessor - Add a Folder column to the Notes tab of the shared library with the same pills, header filter (OR, case-insensitive, Unfiled) and search matching as the note list - Match folder names in ⌘K for both local and shared notes (reason "folder", with a small badge explaining the hit) - Drop noteContexts when forking a shared note: the folder is the author's own filing, not the forker's; it stays visible in the column Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 |
Contributor
Adversarial probesClick to expand probe results |
This was referenced Sep 3, 2026
Merged
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.
何を変えたか
共有ライブラリの ノート タブに「フォルダ」列を足した。共有した時点のフォルダがピルで並び、列ヘッダのフィルタ(OR・小文字比較・未分類)と検索語で絞り込める。ノート一覧の同名列と同じ見せ方。
なぜ
先生が学生の共有ノートを見るとき、作成者だけでなく「どの実験シリーズのノートか」で絞りたい(#825 / #828 の続き)。共有ノートの本文 JSON にはフォルダ(
noteContexts)が入っているのに、一覧が使うメタデータには題名しか無かった。設計上の判断
extra.noteContextsを書く(追加のみ・任意項目。共有フォーマットの構造は変えない)。再共有でも上書きされるnoteContextsを派生メタとして localStorage に控える(hash 照合付き。共有から消えた id は落とす)。新しい読み取りは増えない。表・検索はgetSharedNoteContextsの 1 か所(extra → 派生メタ → 空)で値を引く変更点
share-note.ts:shareNoteがextra.noteContextsを書くshared-library-store.ts: 派生メタ(graphium-shared-derived-meta)の記録・復元・掃除、getSharedNoteContextsshared-entry-source.ts:extractSharedDerivedMeta(note かつ hash 一致の本文からだけ拾う)SharedLibraryTable.tsx: フォルダ列(ContextBadge最大 2 + 「+N」)、FilterPopup(色ドット・未分類は中空ドット)、検索語のフォルダ一致、ヘッダのツールチップcomposer/search.ts+Composer.tsx: "folder" 理由とバッジfork-note.ts:noteContextsを外すlibrary.filterFolder。マニュアル storage-and-sync(日英)に 2 文。バッジはリリース後レビュー
2 観点(正しさ・ノート一覧との一貫性)のレビューと各指摘への 3 名の反証を経て、確定 3 件(フィルタ選択肢の色ドット、ヘッダのツールチップ、空欄ダッシュの薄さ)を修正し、それぞれテストを足した。
Test Plan
pnpm exec tsc --noEmitpnpm vitest run(main 取り込み後に全件通過。新規: share-note の extra、派生メタ、getSharedNoteContexts、searchNotes / searchShared の folder、fork の noteContexts、表の見た目 3 点)pnpm buildpnpm lint:deps(新規 violation なし)pnpm manual:checkSharing/SharedLibraryView: フォルダ列のピル・フィルタのポップアップ(色ドット・未分類)・フォルダ無し行のダッシュ🤖 Generated with Claude Code