fix(web): mid-turn refresh resilience, artifact side panel, clipboard over HTTP, recall purge on chat delete#104
Open
dingirut wants to merge 8 commits into
Open
Conversation
navigator.clipboard only exists in secure contexts, so the copy buttons (reply + code blocks) silently did nothing over LAN http. Fall back to a hidden-textarea execCommand copy, and surface a failed state instead of silence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Chat: file cards for markdown/html artifacts get a preview toggle — markdown renders in place, html loads in a sandboxed iframe (opaque origin, no access to the console API), plus an open-in-new-tab link. Files: html files render by default with a Rendered/Source toggle, alongside the existing markdown view. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Preview now opens in a right-hand panel next to the chat instead of expanding inside the message box. The panel's left edge drags to resize (300px – 75% of the window, width persisted in localStorage); Escape or × closes it, switching chats closes it too. On mobile the panel goes full-screen. The originating file card highlights while its artifact is open, and iframe pointer events are muted during the drag so the divider never loses the pointer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two bugs compounded: - the transcript endpoint 500'd on multimodal tool results (list content, e.g. browser screenshots) — after a refresh the whole history failed to load - the history query result was only applied when no turn was in flight, but `processing` was not a dependency of the apply effect, so a fetch that raced an active turn was dropped forever — the page showed a live "thinking" turn with no prior messages, and the next committed reply rendered as the only message in the chat History now applies as soon as the turn settles, refuses to let a stale fetch wipe newer live-committed messages, and refetches a few seconds after each turn to reconcile with the lazily-persisted session. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deleting a session only unlinked its transcript file — the chat's chunks stayed in the recall index, so the agent could still surface a conversation the user had explicitly deleted. Session deletion in the web console now also removes the dialogue's chunks (vec + FTS via the existing delete_source) and its index_state cursor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The live turn (tool timeline, intermediate text) existed only in the browser tab's memory, so refreshing mid-turn dropped the visible web-search/tool activity even though the agent kept working. The web channel now accumulates the in-flight turn server-side and ships a snapshot in the connect state event; the client rebuilds the live view from it, and `processing` in the snapshot is now real. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The history-apply effect refused to run while processing — with the now-accurate processing flag from the connect snapshot, a mid-turn refresh kept the history empty for the whole turn. Apply immediately; the monotonic length guard plus the post-turn refetch already protect against a stale fetch wiping live-committed messages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The agent persists a turn's user messages only when the turn ends, so after a mid-turn refresh the freshly fetched history lacked the message that started the turn. The web channel now buffers the in-flight turn's user-message echoes and ships them in the connect snapshot; the client renders them above the live turn and folds them into the transcript on commit. Messages sent into a snapshot-restored turn join the same buffer so nothing duplicates. Co-Authored-By: Claude Fable 5 <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.
Follow-up to #103 — polish and fixes surfaced by daily use of the web console.
Artifact previews (.md / .html)
.htmlrenders by default with a Rendered/Source toggle.Mid-turn page refresh no longer loses anything
Refreshing while the agent is working used to drop the whole picture. Fixed end to end:
Clipboard on plain-HTTP deployments
navigator.clipboardonly exists in secure contexts, so the copy buttons silently did nothing over LAN http. Added a hidden-textareaexecCommandfallback (reply copy + code blocks) and a visible failed state.Privacy: deleting a chat now really forgets it
Deleting a session only unlinked the transcript file — its chunks stayed in the recall index and the agent could still surface the deleted conversation. Deletion now purges the dialogue's chunks (vec + FTS) and its index cursor.
Testing
🤖 Generated with Claude Code