fix(ui): roll back refused actions, own background work, unify dialogs - #191
Merged
Merged
Conversation
Several surfaces held state that no longer matched what the main process had actually done, or kept it past the point where it was meaningful. - chat: `continueMessage` set the message to `pending` and registered the live turn before the IPC. A `continuation-limit` refusal left it spinning forever; roll the optimistic state back on refusal or a rejected invoke. - settings: X / Esc / overlay closed without discarding `pendingSettings` / `pendingConnections`, so unsaved edits reappeared on reopen. Route every close through one `handleClose`, and give the dialog the Radix title/description. - knowledge: replace the single `isIndexing` + `indexProgress` with `indexingJobs` keyed by documentId and fed by per-document progress. Refreshing after an import no longer clears the queue, so the top progress stays up for the whole background index. - knowledge: URL, pasted text and notes now register a `pending` source and index in the background like file imports; the Add Source dialog only tracks the short `isSubmitting` registration. - dialogs: collapse `ConfirmDialog`, `DeleteConfirmDialog`, `DeleteNoteConfirmDialog` and `UnsavedChangesDialog` into one `ConfirmActionDialog` on `AlertDialog`. Replace the remaining native `alert()` with Sonner, and make Quiz/Anki config close-on-cancel discard temporary input. - floating panels: dismiss the session switcher and the library add menu on an outside press via a document listener. The full-viewport overlays lost to sibling `position: relative` cards, and the one inside a `-webkit-app-region: drag` header had its clicks eaten by window dragging. - chat: inset the bottom scroll fade by the scrollbar track so it no longer paints over the scrollbar.
Radix wraps a ScrollArea's children in an inner `min-width: 100%; display: table` box. A table shrink-wraps to its content's min-content width, so a `truncate` row with a fixed-width control beside it (the library's document row and its overflow menu) makes that box wider than the viewport once the panel reaches its 260px minimum. The row then runs past the list's `p-2` and out to the viewport edge, so the right padding disappears under the item and the scrollbar. Force the wrapper back to a normal block in the shared ScrollArea, which constrains children to the viewport again. The `!` is needed because Radix writes both properties inline. Horizontal table scroll areas are unaffected: a block wrapper is still 100% wide and the wider table overflows it, so the scroll width and the horizontal bar are the same.
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.
What does this PR do?
Fixes a group of interaction/lifecycle bugs that share one shape: a UI surface
kept state that no longer matched what the main process had actually done. It
also consolidates the duplicated confirmation dialogs and replaces the last
native
alert()s.This is cleanup on top of the worker + background-ingestion work (#176), not a
change to that architecture.
Why?
continueMessage()marked the messagependingand registered the live turnbefore the IPC. Main refuses past the continuation bound, and the invoke can
reject as well — either left the message showing "generating" forever.
SettingsDialogonly seededpendingSettings/pendingConnectionsonmount, and X / Esc / overlay closed it without discarding them, so unsaved
edits came back on reopen.
refreshAfterImportstill cleared
isIndexing, so the top progress vanished while embedding wasstill running. URL / pasted text / notes still blocked their dialog for the
whole index, which made them inconsistent with file imports.
DialogandAlertDialog; a few nativealert()s disagreed with the global Sonner style;and the Quiz / Anki config dialogs disagreed on reset-on-close.
What changed?
streaming pointer, assembler, sequence) when Main refuses or the invoke
rejects.
handleClose()that discardspending settings/connections; add the Radix
DialogTitle/DialogDescription.isIndexing+indexProgresswithindexingJobskeyed by
documentId, fed by per-document progress broadcasts.refreshAfterImportno longer clears the queue, and the top bar shows"Indexing N sources · X%".
pendingsource andindex in the background queue like file imports; the Add Source dialog only
tracks the short
isSubmittingregistration.ConfirmDialog,DeleteConfirmDialog,DeleteNoteConfirmDialogandUnsavedChangesDialoginto oneConfirmActionDialogonAlertDialog; replace the remaining nativealert()with Sonner; Quiz / Anki config discard input on close and reset onsubmit.
an outside press via a document listener. The full-viewport overlays lost to
sibling
position: relativecards, and the one inside a-webkit-app-region: dragheader had its clicks eaten by window dragging.paints over the scrollbar.
display: tablewrapper toblock,so a
truncatelist row can no longer outgrow the viewport and cover thelibrary's right padding at the panel's minimum width.
How was this tested?
npm run typecheck,npm run check:design,npm test(478/478),npm run build:unpackandnpm run smoke:packagedonUbuntu, macOS and Windows.
background file-import progress, URL / text / note import, outside-click
dismissal of the session switcher and the library menu, and the library at its
260px minimum width.
Screenshots / recordings
Not captured in this environment; the affected surfaces are the chat panel, the
Settings dialog, the library list/menu and the session switcher.
Checklist
npm run typecheckpasses.npm run buildpasses.Desktop / build changes