feat(web): 分野逆参照をツリーペインでは現ドキュメントに絞る(案B)#12
Merged
Conversation
ツリー右ペインで CFSubject を開いたとき「この分野を設定している項目」を 現ドキュメント内に絞って表示する。単独 /uri/ ページは従来どおりテナント横断。 スコープは _detail_extras が doc を受け取るか否かで決まる(ページ=doc None= 横断 / ペイン=その doc)。 - repo: list_items_by_subject / count_items_by_subject に document_id を追加 - web.py: include_subject_items を廃止し doc 有無でスコープ。_render_tree_page と _pane_fragment_response の両ペイン経路で doc スコープ計算。fragment ルートに doc クエリ対応、subject_items に scope_doc を持たせページングでスコープ維持 - template: subject_items.html の「もっと見る」URL に doc を付与 - tests: doc スコープ(repo / _detail_extras / ペイン表示 / fragment / もっと見る URL に doc / bad doc 400)。旧 pane 抑制テストを doc スコープ表示に置換 - docs: web-ui.md に「どの情報がどの画面にどの条件で出るか」の総まとめ表を追加、 分野逆参照のサーフェス別スコープ(案B)を明記 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XXFogp18twGiPFBAZcqJw2
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.
概要
CFSubject(分野)の「この分野を設定している項目」逆参照リストを、画面によってスコープを変える(案B):
/uri/{subject}ページ … テナント横断(全ドキュメント。従来どおり)背景
これまでツリー右ペインでは逆参照を非表示にしていた(ペインはドキュメントスコープ・横断リストは場違い・重い、という理由)。だが単一文書テナントではその難点が起きず、ツリーで分野をクリック→一覧が自然な動線。そこで「ペイン=現ドキュメントに絞る/ページ=テナント横断」に変更。ペインの一覧は必ず同ツリー内の項目になり(別文書へ飛ばない)、件数も小さく、クエリも軽い。横断テナントでも破綻しない。
実装
list_items_by_subject/count_items_by_subjectにdocument_id引数(指定時その文書に限定)。include_subject_items廃止。スコープは_detail_extrasがdocを受け取るか否かで決定(ページ=doc None=横断/ペイン=その doc)。SSR deep-link (_render_tree_page) と HTMX フラグメント (_pane_fragment_response) の両ペイン経路で doc スコープ計算。fragment ルートにdocクエリ対応、subject_items.scope_docで「もっと見る」もスコープ維持。&doc=を付与。web-ui.mdにサーフェス別スコープ(案B)と、「どの情報がどの画面にどの条件で出るか」の総まとめ表を追加。テスト(19件 / 全696 pass)
repo の document_id 絞り込み、
_detail_extrasの doc 有無スコープ、ペインフラグメントが現ドキュメント分を表示、横断時の絞り込み(doc A/B)、「もっと見る」URL に&doc=が乗る、bad doc → 400。🤖 Generated with Claude Code