b4c0e00a4fcc0287d0bb32fd7cb0d8b286af73ed
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
54cde7106a |
ui: expand the chat form into a large editor for longer messages (#31973)
* ui: expand the chat form into a large editor for longer messages The chat form expands into a large editor once a message has markdown beyond plain paragraphs or reaches four lines, and a Maximize button in its top-right corner toggles it by hand. The expanded form starts around half the screen height and grows with the text up to the space below the tabs bar, animating its height by mirroring the editor's content height. On a new chat the expanded form keeps the collapsed form's top edge and the greeting only fades out, waiting for a collapse to settle before it fades back in. In a conversation the messages follow the form as it grows, so the latest one stays in view above it. Assisted-by: Claude (Opus 5.5 Medium) * ui: make the expanded chat form a full-screen sheet on phones In the expanded editor Enter adds a line and Cmd/Ctrl+Enter sends. On a phone the expanded form is a full-screen sheet with no corners or border. The page around it and Safari's bars take its colour, and the sidebar's logo button and the working-directory chip step aside while it is open. It moves by relative offsets and a clip on the main thread, so its edges, text, actions and chip stay in step in every engine, and its content keeps the collapsed card's places and widths, so nothing reflows when it settles. Expanding does not focus the editor on a phone. On a new chat on desktop the form is lifted by its sticky bottom offset instead of a translate, and the expanded size is built on the collapsed card's real height, so its top edge holds still through any sequence of quick toggles. Assisted-by: Claude (Opus 5.5 Medium) * ui: hide the phone menu toggle and the sheet's focus edge while expanded On a phone the menu toggle rides on the page, above the chat form: it now fades out while the expanded form covers the screen, and comes back when it collapses. The expanded sheet also drops the glass rim and inner ring, so focusing the editor no longer outlines the whole screen. Assisted-by: Claude (Opus 5.5 Medium) * ui: keep the expanded phone sheet clear of the status bar The expanded chat form fills the screen on a phone, under the status bar an installed app draws over the page. Its text now starts below the bar (pt-safe) and its collapse button sits below it too (top-safe-2.5). Assisted-by: Claude (Opus 5.5 Medium) * ui: hide the phone's context gauge while the chat form is expanded The gauge pinned to the phone's top right sat over the expanded sheet's collapse key. Like the menu toggle across from it, it now fades out while the expanded form covers the screen and comes back when it collapses. Assisted-by: Claude (Opus 5.5 Medium) * ui: lift the expanded phone sheet's actions above the iOS keyboard Assisted-by: Claude (Opus 5.5 Medium) * ui: move the chat form with a short, quick drift, without sliding after it lands Its position transition came back on before the browser had laid out the new position, so it slid the form there after the fade; the drift is now 10px each way and quicker. Assisted-by: Claude (Opus 5.5 Medium) * ui: style the expanded chat form with master's surfaces until the design system lands Assisted-by: Claude (Opus 5.5 Medium) * ui: tighten the expanding chat form after review - Expand on markdown only in finished lines: a lone `-`, `#` or `1.` on the line being typed no longer opens the large editor. - Show "Cmd/Ctrl+Enter to send" by the send button while expanded. - Move the expansion state, the phone sheet and the held collapsed height into useChatFormExpansion, and the sheet's geometry into pure functions. - Drop the working-directory chip's phone animation, which never ran since the phone chip moved to the + menu. - Clearing or sending mid-move cancels the sheet's animation. - A click only continues at the end of the text when it lands below it. - Reuse ActionIcon for the toggle and INPUT_CLASSES for the card, derive the centered form's offset from its drop, name the shared easing and fade. - The greeting owns its fade behind the expanded form. - MarkdownEditor's view is reactive, so following its content starts once it exists. Assisted-by: Claude (Fable 5.2) * ui: keep the expanded chat form to the message being written - The form expands on its own only for what is written or pasted, and another conversation starts collapsed: a restored draft no longer opens the large editor, or the phone sheet, on arriving at a chat. - In the expanded editor the pickers open by the line being written, above it or, short of room, below, instead of above the form's top edge. - The sidebar's swipe is off while the phone sheet covers the screen. - The send hint shows only beside the send button, where the row has room. - The inner area keeps master's focus shadow, except on the phone sheet. - The card and the form's position honour reduced motion. - The phone greeting's place accounts for the wrapper it is counted from. - The sheet's animation tolerates the form going away mid-move. Assisted-by: Claude (Fable 5.2) * ui: turn the typed pickers off on phones, and scroll long messages - On a phone, typing `/` or `@` opens no picker for now: each mobile browser moves the page its own way as the keyboard opens, so a list by the form can not stay clear of the text being written. A note marks it for later. - The editor scrolls inside the form again: MarkdownEditor's own box sat between the input and the editor without taking its height, so a message longer than the form ran under the actions instead of scrolling. Assisted-by: Claude (Fable 5.2) * ui: settle the expanding chat form's review findings - A phone expands the form only by hand: the sheet switching in mid-typing moves the text under the keyboard. - The typed pickers are off wherever a finger is the main pointer, not below a viewport width, so a narrow desktop window keeps them and an iPad loses them. The prompt picker opened from the + menu floats by the sheet's actions on a phone. - A message put back after a failed send expands the form again. - Only the left button moves the caret from a click below the text. - The sheet's fill is one token, used by the sheet, the page and Safari's bars. - The collapsed-height hold is its own module and no longer finds the editor's elements by class name. - Shorter comments. Assisted-by: Claude (Sonnet 5.5) * ui: keep a one-line message on the chat form's actions row On a desktop the main chat form is a single pill while its message is one line: the add button, the text, then the model selector and send. A second line, or a line that wraps beside the actions, brings back the two rows, and they stay until the text is shorter than where it wrapped, so the wider row can not flip it straight back. The editor stays mounted: the actions join the text's row by CSS alone. The single row's corners are `--chat-form-single-row-radius` in app.css, a pill by default; the "Scrapbook / ChatForm single row" story shows the real form with other radii. Assisted-by: Claude (Opus 5.5) * ui: give the one-line chat form 1.25rem corners Assisted-by: Claude (Opus 5.5) * ui: pick the working directory from the + menu on desktop too The chip under the chat form is gone: the + menu offers the working directory everywhere but a phone's chat, whose header shows it. The menu item names the directory once one is set, and the picker gains a row to clear it, which the chip's X used to do. Assisted-by: Claude (Opus 5.5) * ui: put the single-row chat form behind a Display setting "Single-row chat form for short messages", on by default. Assisted-by: Claude (Opus 5.5) * ui: send the chat form on Enter, and add a line with Shift or Ctrl/Cmd Enter sends wherever the caret is, the expanded editor and code blocks included; Shift+Enter and Ctrl/Cmd+Enter add a line, continuing lists and quotes. With "Send message on Enter" off the two swap as before. The expanded editor's send hint and the code-block rule are gone with it. Assisted-by: Claude (Opus 5.5) * ui: start the chat form on the row layout it will settle on Assisted-by: Claude (Opus 5.5) * ui: show a set working directory under the chat form again On desktop the chip under the form is back once a directory is set, and the + menu offers the directory only until then. Assisted-by: Claude (Opus 5.5) * ui: add a line on Enter with an on-screen keyboard A phone's Return has no Shift, so on a touch screen Enter adds a line and the send button sends, as "Send message on Enter" turned off does; on a desktop Enter still sends. Assisted-by: Claude (Opus 5.5) |
||
|
|
1a97e387d3 |
ui: add conversation compaction (#27401)
* ui: add conversation compaction Add a compaction action that asks the model to summarize the conversation so far and stores the summary in a new compaction node appended to the branch. Later requests slice the branch at the last compaction node, keeping the system prefix and continuing from the summary instead of the full history, which frees up context while the complete history stays visible and navigable in the UI. The slice is applied once at the request funnel, covering the plain send, the agentic flow and the KV cache pre-encode, plus the continue path that bypasses it. The summary request is a one-shot outside the SSE replay machinery, streamed live into the node with a full rollback on abort, error or empty result. The action is exposed as a /compact slash command and a Compact button in the context gauge popup, with an overridable summarization prompt in the settings. * ui: pre-fill KV cache and refresh context gauge after compaction Once the summary is stored, pre-encode the compacted branch and stamp the returned prompt timings on the compaction node: re-encoding the reduced prefix is part of the compaction itself, so the server KV cache and the context gauge reflect the summary right away. The summary stream is registered under a prefixed identity (compact::convId), so the visibility kick and byte-offset resume protect it through tab switches while the reload probe never reattaches it as a chat turn. The stamped node becomes the shared context truth for the gauge and the processing state restore, and the stale live state that kept the gauge full is cleared. * chore: format * ui: allow a dedicated model for conversation compaction An opt-in setting reveals a model selector whose options come from the live router model list. The chosen model writes the summary and is loaded on demand when it is not resident, while the default path keeps resolving to the conversation's own model. * ui: align the compaction model field with project conventions * ui: fix the model option helpers import path The compaction model selector pulls filterModelOptions and groupModelOptions from the models component folder, where they no longer live, so the build fails to resolve the module. Point the import at the navigation folder, which now owns them. Missed during the rebase: the helpers moved in a commit that does not touch any compaction file, so nothing conflicted. * ui: import the model option helpers from models/utils * ui: follow the moved models selector in the compaction model field The models manager moved ModelsSelectorList under ModelsSelector and the model option helpers to /utils, where groupModelOptions takes the options alone. Drop the stale copy the rebase kept and read the helpers from their new home. * ui: drop the dedicated compaction model A summary written by another model loses the prefix the conversation model cached, so the whole history is prefilled again, and the model then resumes from text it did not write. The conversation model always writes its own summary. * ui: keep the last steps of a compacted conversation A compaction now folds the steps the model reads but the last ones, a step being a user message or an assistant message with its tool results, and stores how many it kept on the compaction node. The model then reads the system prefix, the summary, the kept steps and what follows. The summary request is the request the chat sends, with its options, tools and message shaping, cut before the preserved steps: the server reuses the prefix it cached and only the instruction is new. The number of preserved steps is a setting, 10 by default. * ui: run every compaction summary through one path Three callers needed the same thing - the automatic pre-encode pass, the action in the context gauge, and re-running a summary from the block - and each of them had grown its own copy of the request, the streaming and the storing. There is one path now: a summarization owns a node, streams into it, and reports itself through a ledger the rest of the app reads (`isCompacting`, which node belongs to which conversation). Re-running a summary is the same call on an existing node, so the two entry points cannot drift apart again. * ui: give the compaction row its own summary UI The summary was a line of text in a tool-call-shaped collapsible, which is how a compaction reads as a side note rather than as the thing the rest of the conversation now stands on. The row is its own block: a divider that names the boundary, and the summary inside it with the model that wrote it, its statistics, and the same actions an assistant turn has - copy, edit, fork, regenerate and delete all apply to the summary, and it collapses to the divider once a summary is in, because the shrunk context is the headline and the prose is the detail. The divider is a variant of the shared collapsible block, which also needed the toggle and the title split into snippets so a caller can lay them out without copying the markup. The action icons no longer take a role: they render what a message offers, and a compaction offers the same as any other stored message. * ui: report compaction progress on the row The row owns the run, so the row says how it is going: the prompt progress in the header while the context is being read, the phase once the summary starts streaming, and the token count once it is in. Before the first summary token there is nothing to collapse, so the header stands on its own instead of offering an empty block. * ui: keep the summarized turns quiet while a compaction runs The turns being summarized used to keep their own "Processing..." indicator and live reading stats while the summary streamed, so the conversation said the same thing twice in two places. The row reports the run, so the turns it replaces stay silent until it is done. * ui: hand the compact action to the context gauge Compacting is a decision about the context, so the action belongs with the numbers that show the context filling up rather than inside the form: it sits at the bottom of both the hover card and the drawer, under the breakdown it acts on, quiet enough to stay a footnote and disabled - with the row's own spinner - while a summary is already running. * ui: follow the bottom, otherwise leave the view alone The screen scrolled itself with a controller of observers, intervals, direction heuristics and landing timers, and still managed to move the view while the reader was reading: any mutation that grew the branch was treated as a reason to keep following. The page is the scroller, so it follows when the reader sits at the bottom, and stays where it is otherwise. A resize observer plus native scroll anchoring does the rest, and `pointerdown` buys the reader a moment of grace to be caught mid-drag. * ui: expand collapsible bodies with a height transition Expanding a block snapped it open: the body was mounted the moment `open` flipped, so a tall block moved the conversation around it in one frame. The body now goes through the same region the models table uses. The height interpolates and the visibility follows it, so a body is unmounted once the collapse has finished rather than the moment it starts - a closed block still costs nothing while tokens stream past it. * ui: open a compaction summary at the top of the screen Toggling a summary left the reader wherever they were, so a conversation that had just compacted showed the divider at the bottom of the screen and read down from there. A toggle now scrolls the page once and lands the divider a breath under the tabs, both ways: the summary is read from its beginning, and closing it returns to the same boundary instead of wherever the page happens to come to rest. The scroll waits for the body to reach its height, because before that the page is too short to scroll the divider up there and the call would clamp. That wait is the shared collapse duration rather than a transition event: an engine without `interpolate-size` animates the region's grid row instead of its height, so a listener on `height` would never fire there and the page would not move at all. * ui: spin the compaction icon while the summary runs The divider reported the phase in its title while the icon still showed a finished block, so a run in progress and a summary that had landed looked the same in the one place the eye reads first. The icon spins while the summary is running and folds back once it is in. * ui: let the compaction summary speak without the reasoning trimmings The summary is the thing the conversation now stands on, not a note beside it, and the conversation model always writes it, so the body drops the reasoning block's rule and indent (`flushBody` keeps them for the blocks that borrow them) and the model selector under the summary is gone - there is nothing left to swap. * ui: drop the model override from the compaction path The summary row no longer offers a model selector, so nothing hands regenerateCompaction a model anymore. Remove the parameter from the whole path, with the on-demand load of another model it carried: the summary always comes from the model the request funnel resolves. * ui: let the compaction summary think as the chat does The summary request forced thinking off, overriding the reasoning effort the user chose. The summary is the text the conversation resumes from, the task where reasoning helps the most, so the request now carries the very options of the chat. * ui: pre-encode the compacted branch as the next turn reads it The post-compaction pre-encode sent the branch without tools, while the tools render ahead of the messages, so it warmed a prefix the next turn never reads and that turn prefilled the whole compacted context again. The pre-encode now sends the tools, message shaping and reasoning handling of the chat, so the next turn only prefills its new message. * ui: pre-encode the branch the next turn actually reads The per-turn pre-encode sent the messages of the request plus one assistant message holding the streamed text, without tools. With tools on, it replaced the slot the next turn extends with a prefix nobody reads again, and after an agentic turn its history did not match the stored calls and results. Without agentic, it never ran. Both pre-encodes now read the stored branch up to its leaf, cut at the last compaction, and send it with the tools, message shaping and reasoning handling of the chat. The plain completion path triggers it too. * ui: refuse a compaction summary the output limit cut The stream handler read every chunk but dropped the finish reason, so a summary cut by max_tokens folded the conversation into half a text. The handlers now hand the finish reason to onComplete, and a summary that ends on length rolls the compaction back with an error. The summary was framed through a replacement string, so $& or 32560 in it changed the text the model read; it is framed as written now. * ui: wait for the collapse transition in the tool call tests The collapsible body now unmounts once its collapse animation ends rather than as soon as the block closes, so the "folds back" assertions ran before the body was gone. Wait out COLLAPSIBLE_TRANSITION_MS first. Assisted-by: Claude (Opus 5.5 Medium) --------- Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com> |
||
|
|
92d1bb0c99 | ui: Linting & Formatting scripts (#26819) | ||
|
|
18f7ad7fc9 |
server, ui: only offer a working directory when a tool reads it (#26762)
The working directory chip showed up as soon as the server exposed any builtin tool, so a server started with just get_datetime, or a user who turned every filesystem tool off in the settings, still got a control that nothing would read. Tools now declare whether they resolve their paths and run against the working directory, next to the write permission they already publish in the /tools listing. The WebUI shows the chip and enables the /cwd command only when at least one such tool is both served and left enabled. |
||
|
|
6de1b63473 |
allozaur/feat/chat slash commands (#26716)
* base : slash-command/misc foundation - model icon and focus-selector constants * feat : slash-command picker and command parsing helpers * refactor : wire command and @-mention pickers into the chat form * ui : improve model selector keyboard navigation and load/dismiss * feat: Unify markdown/raw-text rendering under one setting with migration * fix: Misc fixes - tool-call subtitle, assistant wrap, progress guards * feat: Clamp and style numeric settings inputs from registry bounds |