Skip to content

fix(viewer): preserve semantic response chunks - #184

Closed
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-response-viewer
Closed

fix(viewer): preserve semantic response chunks#184
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-response-viewer

Conversation

@Lint111

Copy link
Copy Markdown
Contributor

Summary

Make the response viewer preserve semantic reply boundaries and support lossless whole-chunk copy on desktop and mobile.

Changes

  • Remove terminal-buffer fallback from Last Response.
    • An empty structured transcript now shows the existing empty-state message.
    • It no longer presents the entire terminal history as if it were one agent reply.
  • Store each reply's raw transcript text on its owning response node.
  • Double-click or double-tap a reply to copy that complete raw chunk.
  • Ignore copy gestures that originate from buttons, links, fields, or editable content.
  • Keep existing one-click code-block copy and diagram wrap controls unchanged.
  • Show brief visual confirmation after a successful whole-chunk copy.
  • Use mobile terminal feedback when that optional control layer is present.

Behavior

  • Last Response remains a single structured reply.
  • More remains the explicit path to the full conversation.
  • Raw Markdown, whitespace, and code fences survive whole-reply copy without depending on rendered HTML.

Validation

  • npx vitest run --config config/vitest.config.ts test/response-viewer.test.ts
    • 2 tests passed
  • npm run check:frontend-syntax
    • 26 frontend files passed
  • npm run build
    • passed

Scope

This PR does not add click-to-collapse for response messages. That interaction was discussed but is not implemented in the audited change set and should be reviewed independently from copy/source correctness.

Keep Last Response transcript-only so terminal history is never presented as one reply. Store raw message sources for lossless double-click or double-tap copy with visible feedback.
@Lint111
Lint111 marked this pull request as ready for review August 2, 2026 05:41
CopilotAI review requested due to automatic review settings August 2, 2026 05:41

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Preserves semantic response boundaries in the Response Viewer by attaching raw transcript text to each rendered response node and enabling lossless whole-chunk copy via a double-click/double-tap gesture, while removing the misleading terminal-buffer fallback for “Last Response”.

Changes:

  • Removed terminal-buffer fallback for Last Response and left the existing empty-state message when the structured transcript is empty.
  • Stored raw transcript source (_codemanCopyText) on the owning response DOM node and added dblclick-based whole-chunk copy with feedback + gesture filtering.
  • Added a focused test suite covering empty transcript behavior and chunk-copy source selection.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
test/response-viewer.test.tsAdds regression tests for empty transcript handling and whole-chunk copy behavior.
src/web/public/styles.cssAdds copy-feedback animation and touch-action: manipulation for the response viewer / messages.
src/web/public/app.jsImplements semantic chunk copy, stores raw source on nodes, and removes terminal fallback from Last Response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/web/public/app.js
Comment on lines 1967 to 1969
const body = document.getElementById('responseViewerBody');
body._codemanCopyText = lastResponse;
if (lastResponse) {
Comment on lines +25 to +29
setInterval: vi.fn(),
clearInterval: vi.fn(),
setTimeout,
clearTimeout,
requestAnimationFrame: vi.fn(),
@Ark0N

Ark0N commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Hi Lior, closing this one as part of a cleanup of the seventeen PRs currently open from you. The full explanation is in #173, and I would rather you read that one than this note, because it is the honest version and it is not a dismissal of your work.

The short form: sixteen PRs opened in a single day, roughly 42,000 added lines in total, landing mostly on the same few files (nine touch app.js, eight touch terminal-ui.js), with five already conflicting against master and none carrying CI results. I cannot review that at the standard this codebase needs, and merging it at a lower standard would be worse than not merging it.

Going forward, please keep no more than three open PRs at a time, each one a single behavior change that stands on its own, with a test that fails on master and passes with the fix. #214 and #215, merged today, are good models.

If this particular change fixes something that genuinely annoys you in daily use, it is a good candidate to be the first one you reopen on its own, rebased on current master. I will review it properly.

Thanks for the effort you put in, and sorry to close it this way.

@Ark0NArk0N closed this Aug 5, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Lint111@Ark0N