fix(context): unify "add to context" vocabulary + broaden composer picker + tree attach#214
Merged
Merged
Conversation
…cker + tree attach Addresses three recorded frontend issues about the context-attach UX. #1 — Composer "Add context" only offered Plan + Recent decisions, though the model supports more channel-scoped kinds. Broaden the quick-pick to Plan · Recent decisions · Sessions · Cost (the target-less channel reads), and add a footer note that files / messages / a bot's workspace files attach from their own panels (they need a specific target). #2a + #3 — The same act (attach a resource to the next message's context_bundle) wore three head verbs across five surfaces ("Add context" / "Attach" / "Attach this file|board|the selected lines"). New single source of truth `context/contextLabels.ts`: one head verb "Add … to context", object explicit, scope "your next message". Applied to the composer menu, RemoteWorkspace attach, and Workbench file/board/passage. (File-UPLOAD "Attach file" left as-is — it's a different concept, and the split now disambiguates it.) #2b — RemoteWorkspace file tree had no attach affordance; you had to open a file first. Add a per-row hover "add to context" button on file rows (dirs excluded), reusing AttachContextButton + workspaceContextItem. Cheap because a workspace.read attach is a text-only reference (bot_id + path) — no file read needed. Labels/UX only; no behavior change. tsc (touched files) + vite build clean; #1 verified live on kind (popover items + footer + unified button title). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cf41f7c8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…/cost + preserve workspace root Two review findings on the context-UX PR: [P1] The composer picks reference channel.plan.read / sessions / usage, but the MCP bridge exposed NO tool for them (also true for the pre-existing Plan pick) — so the recipient couldn't resolve them (unknown tools reject). Add read-only MCP tools `read_plan` / `read_sessions` / `read_cost` mapping to those verbs. [P2] A workspace.read tree/opened-file reference recorded only the relative path; when browsing a non-default allowed root the broker passed no root and the connector fell back to its default cwd / first allowed root — resolving a different same-named file or failing. Thread the browse root end-to-end: workspaceContextItem(root) → params.root → MCP read_workspace copies `root` → broker_workspace_read reads it → read_workspace_file_as_bot → workspace_call(root). Root is now part of the reference identity (same path under two roots ≠ same chip). Builds + tests green (MCP, gateway, frontend vitest incl. new root case). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes the three recorded frontend context-UX issues.
#1 — Composer "Add context" was too narrow
Only offered Plan + Recent decisions, though the model supports more channel-scoped kinds. Broadened the quick-pick to Plan · Recent decisions · Sessions · Cost (the target-less channel reads), + a footer note that files / messages / a bot's workspace files attach from their own panels (they need a specific target, so they don't belong in a target-less menu). ✅ verified live on kind (popover items + footer).
#2a + #3 — "Attach / Add context / Attach lines" vocabulary mess
Same act (attach a resource to the next message's
context_bundle) wore 3 head verbs across 5 surfaces. New single source of truthcontext/contextLabels.ts: one head verb "Add … to context", object explicit, scope "your next message". Applied to the composer menu, RemoteWorkspace attach, and Workbench file/board/passage.#2b — RemoteWorkspace tree had no per-row attach
You had to open a file before you could attach it. Added a per-row hover "add to context" button on file rows (dirs excluded), reusing
AttachContextButton+workspaceContextItem. Cheap: aworkspace.readattach is a text-only reference (bot_id + path), so the tree row already has everything — no file read.Labels/UX only, no behavior change.
tsc(touched files) +vite buildclean. RemoteWorkspace opened-file text (#2a) + tree hover (#2b) need an online bot's workspace to view live — build-clean + structurally verified.🤖 Generated with Claude Code