Repository navigation
feat(ui): rebuild the composer - #886
Merged
Merged
Conversation
small-angel
force-pushed
the
clo/agent-orchestration
branch
from
November 4, 2026 19:18
8a6c698 to
9166caf
Compare
small-angel
force-pushed
the
clo/markdown-composer
branch
from
November 4, 2026 19:21
b68c21d to
0803f1c
Compare
Contributor
[Medium impact] The changes affect the chat-writing workflow and its settings for chat users. Fix shared undo history across chats and Enter handling in Markdown lists before merging. Findings
Fix with agent prompt### Issue 1
ui/src/components/ComposerEditor.tsx:386-391
`ComposerEditor` resets its history only when `value` changes. If a user types and then deletes a draft in chat A, switching to another empty chat leaves A's undo history in the editor. Undo in chat B can then bring back A's text, which the user may send to the wrong agent. Reset the editor when the composer changes chats, even when both drafts have the same text.
### Issue 2
ui/src/components/ComposerEditor.tsx:210-211
`markdown()` installs its own Enter binding unless `addKeymap` is disabled. In a list such as `- investigate this`, that binding continues the list before the lowest-priority `onSubmit` handler runs. Enter therefore adds a line instead of sending lists and quotes. Set `addKeymap: false`; `livePreview` already provides the intended code-block Enter and Shift+Enter bindings.
```suggestion
const markdownSource = markdown({
addKeymap: false,
base: markdownLanguage,
```
### Issue 3
ui/src/components/ModelPicker.tsx:712
The effort popup lost its `maxHeight`. In a short window, `overflow-y-auto` alone does not limit its height, so choices can extend outside the screen without a scrollable popup. Restore a height bound based on `--available-height`, as the permissions popup still does.
```suggestion
<Menu.Popup aria-label={m.model_picker_effort()} className={MENU_POPUP} style={{ width: "min(240px, calc(100vw - 16px))", maxHeight: "min(400px, var(--available-height))" }}>
```
### Issue 4
ui/src/components/ChatPanel.tsx:5282-5283
`addFiles` waits for `FileReader.onload` before calling `insertToken`, which replaces whatever selection exists at that later moment. If a user selects other draft text while a large PDF or image is being read, finishing the read deletes that newly selected text. Capture the insertion position when the file is added and keep it aligned with later edits instead of using the eventual selection.
### Issue 5
ui/src/components/ComposerEditor.tsx:502-506
Skill previews now open only through `onMouseOver`. The old skill token supported focus, Enter, Space, and keyboard scrolling, but `ChipWidget` creates a non-focusable span with no replacement keyboard action. Keyboard-only users can no longer inspect a skill's instructions before sending it. Keep a keyboard-accessible way to open and read `SkillPreviewCard`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryReplaces the textarea with a CodeMirror Markdown composer.
Fix the chat-history boundary and Markdown Enter binding before merging. The remaining comments cover popup sizing, delayed file insertion, and keyboard access.
|
small-angel
force-pushed
the
clo/markdown-composer
branch
from
November 4, 2026 19:48
0803f1c to
59cde16
Compare
small-angel
force-pushed
the
clo/agent-orchestration
branch
from
November 4, 2026 19:50
bbd7aac to
5bc0015
Compare
small-angel
force-pushed
the
clo/markdown-composer
branch
4 times, most recently
from
November 4, 2026 22:34
45d09a8 to
7eea267
Compare
The composer is now a CodeMirror editor running a port of alphaXiv's markdown live preview: formatting renders in place and its marks reveal under the caret. Reveals wait for the mouse button to come up, so a drag selects the text it started on instead of chasing marks that appear under the pointer; a drag that covers a span's text then grows to take its marks. Colors come from the theme's syntax and link tokens, so both themes hold. /commands, @paths that exist in the checkout, and attachments render as atomic chips. Pasted, dropped and uploaded files are cited in the draft as [Image #n] / [PDF #n] at the caret; a send carries only the cited attachments, renumbered in order of mention, so deleting a chip deletes the attachment and the agent sees where each image belongs. This replaces the thumbnail row and the textarea mirror that painted skill chips. Below the box, a Knife-style bar: data sources and mode chips on the left; model, effort and permissions on the right. Effort and permissions split out of the old settings menu, and autonomy joins permissions as a second section. Claude's ultracode, xhigh plus dynamic workflows, toggles beneath the effort levels. The box grows to eight lines, then scrolls; its top edge drags to a remembered height, replacing the textarea resizer from #863 under the same storage keys. Message refs (`msg_…`) paste into the draft as chips with the cited message's author and first words, and read as pills in sent messages. Copy link on a message puts its ref on the clipboard. A ref in the user's own message now expands for the agent like one an agent sends, so the agent reads the cited words instead of an id it cannot look up. `@` opens one add-context menu: files, alphaXiv library papers and chats in the project. A paper enters the draft as a markdown link to its alphaXiv page and shows as a chip, as does one added from the library button, now beside data sources in the bar; a chat enters as its id. Assisted-by: claude-opus-5.5
small-angel
force-pushed
the
clo/markdown-composer
branch
from
November 4, 2026 22:45
7eea267 to
0f32663
Compare
1 task
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.
The composer was a plain textarea. Attachments sat in a thumbnail row, and skills were painted on by a mirror behind the text. It is now a CodeMirror markdown editor, using alphaXiv's live preview: formatting renders in place, and
/commands,@paths, pasted images and PDFs, and message refs appear as inline chips. Model, effort and permissions sit in a compact bar under the box.A few behaviours to know about:
[Image #n]chip is still in the draft, numbered in the order the chips appear, so the agent sees where each image belongs.ultracodeis a toggle on top of XHigh effort.@opens one add-context menu: files, alphaXiv library papers and chats in this project. A paper goes into the draft as a markdown link to its alphaXiv page and shows as a chip, as do papers added from the library button, which now sits in the bar beside data sources. A chat goes in as its id, which agents canread.msg_…). A pasted ref becomes a chip showing who wrote the message and its first words. Until now, a ref the user typed reached the agent as an id it couldn't look up; refs in the user's own messages now expand to the cited message, the same way refs in agents' messages do.Proved by driving the dev server in headless Chromium in light and dark themes (typing, chips, paste, drag-select, resize, menus, Copy link, the
@menu, library papers, and each review fix). For the ref expansion, a fresh OpenCode chat was asked for the secret word in a ref to another chat's message; it answered without calling any tool, both as a new turn and when steered into a running Claude turn. Also ranpnpm typecheck,lint:i18n,lint:stylesandpnpm test(624 pass), pluscargo fmt,clippyandcargo test.Reviewed with sol-loop: 3 rounds with gpt-6.1-sol. Sol verdict: approved in round 2; round 3's one finding (refs in steered messages) fixed as suggested
Assisted-by: claude-opus-5.5
Assisted-by: gpt-6.1-sol