Repository navigation
Description
Follow-up to #2061, which put the document's name first in the tab title.
The agent that launches a session knows what the review is for. The page knows only the file
name and the repo. Letting the caller set the title at launch is the flexible fix: a user can
give their agent a naming rule ("name the tab after the OpenSpec change"), or let it use
judgement, and the resolver never has to learn anyone's conventions.
Where the file name and repo aren't enough today:
- Same-named files. OpenSpec changes, ADR folders and per-feature docs reuse names. Three
open reviews ofproposal.mdfrom three changes each readproposal.md · acme/payments. - annotate-last. Every session reads
Last message · acme/payments. - Code review.
packages/review-editor/App.tsxstill sets<repo> · Code Review, so two
reviews of the same repo (say, a PR and the local diff) share one title.
Proposal
An optional --title <text> on annotate, annotate-last and review that replaces the
whole tab title:
plannotator annotate openspec/changes/add-refunds/proposal.md --title "add-refunds proposal"
| Launch | Tab title |
|---|---|
without --title |
proposal.md · acme/payments |
with --title "add-refunds proposal" |
add-refunds proposal |
- Absent: nothing changes;
documentTabTitlebuilds the title as it does today. - Present: the text is the tab title, exactly as given, with no document name or repo added.
The caller can include the repo itself if it wants it. The server passes the text through
/api/plan(and the review equivalent). - Present: the desktop header shows the same text beside the logo, in place of the file name,
so the page and its tab agree. - The agent-facing tool definitions (the hook and the plugin hosts) expose it as an optional
titlefield, so an agent can name a review without the user asking.
Related: the owner in the default title
The default title spends most of a tab's width on the repo owner. In Firefox, for example, a
tab shows about 25 characters, so idea.md · BenNewman100/plannotator renders as idea.md · BenNewman100/plan….
The repo name alone (idea.md · plannotator) keeps the part that tells tabs apart. Happy to
split this into its own issue if you'd rather.
Questions
- Would you take a caller-set title?
- Which hosts should take it in a first pass: just the CLI, or the tool definitions too?
Happy to send the PR once the shape is agreed.
Drafted by Ben's agent at his request.
Activity
feat(cli): --title names the tab for annotate, annotate-last and review