feat(chat): chip recognised slash-commands anywhere in the message buffer - #1699
Merged
Merged
Conversation
…ffer A recognised command now wears its chip wherever it stands — in the composer, on home's line, and in the sent transcript — instead of only at the head of the draft. "try running /senior-dev on this" chips "/senior-dev" in the box and keeps the chip after the message is sent, and so does every other command resolved through the table (aliases included). The chip is now a recognition mark rather than a send promise: send is unchanged, and only a leading command runs the dispatcher. The tag machinery (liveTags, editTags, demoteTagBehindCaret, the refusal and the hint) stays keyed on commandDoor, and the entry's acted tags are recorded door-only. A path like "/Users/santosh/notes.md" and an unknown word like "/nope" stay plain, because neither resolves through knownCommand. Tests updated in internal/tui3/slashchip_test.go, using /senior-dev as the acceptance sentence.
The chip became a recognition mark in the previous commit, so every recognised command is highlighted in the box and the sent message. One promise was lost with the widening: a send-door tag backspaced to plain words wore its chip again in the transcript, though the box and the manual both say it stays plain. The demoted ranges live in the editor's own rune coordinates and are cleared by the send's reset before the entry is built, so enterLine snapshots them and threads them through the submit doors to the entry's plainTags. The transcript subtracts them against the pre-wrap text, with each wrapped row rebased by its own offset — the wrap drops the spaces at its breaks, so a whole-entry subtraction would mis-chip across rows. A wrapped demotion is tested as well as an unwrapped one. The actedTags field became plainTags, its door-only filter and comment are gone, and commandSpans is collapsed to its shell guard plus a direct recognizedCommandSpans return now that the filter can never fail. The manual pages that still said a chip promised enter would act are rewritten for recognition semantics, including screen.md's "a tinted background is always a slash command that acts". The changelog entry for PR 1699 records the invalidation.
Enter over a running answer parks the message before any submit runs, and the parked record had nowhere to keep the ranges the person backspaced to plain words, so the transcript chipped them again when the message went. A parked message now carries those ranges: park takes them, sendParked and the held conversation's draw pass them to the entry, and recalling the message into the box restores them. The /standing tag's own road parks the words without the tag, so plainWithoutTag carries the ranges into those words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZeroPoint95
marked this pull request as ready for review
October 1, 2026 02:13
…ept plain A picked harness dropped the demoted ranges, so `say /standing` made plain with backspace came back chipped once sent. The guard's send to the conversation, a reopened conversation (or a second window on it), a follow-up and a question's replacement or clarification built their entries with no ranges at all, and drew a door word nobody acted on as a chip. A sentence steered into a running answer and a message waiting for the answer drew no chips at all, while the box and the transcript did. The harness door now carries the ranges; the roads that never act on a send-door tag draw a door word away from the head plain (restingDoorWords), which is how every mid-sentence door word was drawn before; the steered row and the waiting block paint through the transcript's painter. The tab stop is one constant shared by both wrappers and the range mapper. The manual and the change entry say so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Compare slash command chips with the current conversation row in /resume, which still uses the selected ground. Remove the two stale screen claims that the model in use wears that ground, and describe its bold accent ink with no band of its own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
|
Taking over: @ZeroPoint95, checked by hand in the real binary on both roads (engine and Pushed:
Left for later:
|
AbirAbbas
approved these changes
Oct 1, 2026
AbirAbbas
left a comment
Collaborator
There was a problem hiding this comment.
Verified by hand in the real binary on both roads (120 and 62 columns). Merging.
AbirAbbas
added a commit
that referenced
this pull request
Oct 1, 2026
Brings in #1699 (slash chips anywhere) and #1723. enterLine keeps this branch's shape (no marked argument) and #1699's plain-tag snapshot: park(line, false, plain), submitShown/submitImagesShown(..., plain). A queued follow-up's own demoted ranges join #1699's resting door words on its transcript line, so a slash word backspaced to plain before ctrl+enter stays plain when its turn starts. A draft holding a live send-door tag is a command, so ctrl+enter takes enter's road for it instead of queueing the words and dropping the tag. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Ready to review. All four open items from the first review are done, and a reviewer found a gap with waiting messages, which is now fixed too. CI is running on the newest commit,
68db4a0a2.What changes
Every slash command codeaf recognises is now drawn as a chip, wherever it appears in the message: in the box, on home's line and in the transcript.
What stays the same
Pressing enter does exactly what it did before:
/standing,/ordersand/taskstill act anywhere in the message.So the chip used to mean "enter will act on this". Now it means "codeaf knows this command".
The three commits
745fc854c: chips anywhere.commandSpanschips any recognised command, and the transcript draws the same wider chips.617ed0555: a tag backspaced to plain words stays plain once sent.enterLinecopies the backspaced ranges (plainTags) before the box is cleared, and passes them on to the transcript entry.wrapWithOffsetsrecords where each wrapped row starts, sotranscriptCommandSpanscan skip those ranges on every row.tabExpandedSegmentsadjusts the ranges when a tab is widened to spaces.actedTagsis gone, andplainTagsreplaces it.commands.mdandscreen.mdnow say a chip means "codeaf knows this command".68db4a0a2: the same holds for a message typed while an answer is still coming. Such a message waits in a queue until the answer finishes. That queue used to drop the backspaced ranges, so the tag came back chipped.parkstores them, and bothsendParkedand the background-conversation send pass them on.plainWithoutTaghandles the/standing-tag case: that path queues the words without the tag, so the ranges have to be moved to match.Tests
go test ./internal/tui3and./internal/manualsuites pass on68db4a0a2, andgo vetis clean./standingstays plain, and a table test forplainWithoutTag. The first three fail when the fix is removed.Try it
make build, thenbin/codeaf.say /standing, press backspace, then enter./standingis plain, with no chip.Trial binary: sha256
2744a5f6d27e6a8b1798be1b89ffadc17997c6a536a3f5b3f4da9dde55c00900, commit68db4a0a2.🤖 Generated with Claude Code