Skip to content

Fix chat attachment state and duplicate table rendering - #314

Merged
witbrock merged 1 commit into
mainfrom
codex/JVNAUTOSCI-2605-2606-ui-fixes
Jul 27, 2026
Merged

witbrock merged 1 commit into
mainfrom
codex/JVNAUTOSCI-2605-2606-ui-fixes

Conversation

@witbrock

Copy link
Copy Markdown
Member

What changed

  • Keep uploaded-file state outside the chat composer and expose persistent progress/attachment status.
  • Scope in-flight upload guards, progress, completion UI, and pending attachment bindings to the originating conversation.
  • Coalesce repeated in-flight actions without creating duplicate upload concepts or transcript cards, while allowing another conversation to upload independently.
  • Mark tables mechanically derived from inline Markdown as inline_primary, with an explicit source element and line span.
  • Render explicit structured tables as augmenting cards, but suppress a derived card only when source ownership and the live inline presentation are both proven; otherwise fail open so content cannot disappear.
  • Preserve raw/text view faithfully.

Root cause

Upload UI state was page-global even though durable attachment bindings were conversation-scoped. Separately, the display contract did not identify which renderer owned a table derived from inline response content, so both the Markdown renderer and display-element renderer presented it.

User impact

Uploads no longer rewrite the prompt draft, repeat actions no longer duplicate work, conversation switches cannot leak upload state into another chat, and Markdown tables appear once while genuinely explicit structured tables remain available.

Validation

  • 57 passed: tests/backend/test_display_elements_service.py
  • 19 passed: attachment binding, display ownership, and Markdown rendering Jest suites
  • Ruff, ESLint, Node syntax, and git diff --check
  • Live isolated server health on port 5014 and browser inspection of the actual composer/status surface; automated Chrome file selection was unavailable because file-URL access is disabled, so slow-upload and cross-session behaviour is covered by the focused Jest paths.

Copilot AI review requested due to automatic review settings July 27, 2026 17:41
@witbrock
witbrock marked this pull request as ready for review July 27, 2026 17:45

Copilot AI 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

This PR fixes two user-facing chat issues in Von’s web UI: (1) attachment/upload UI state incorrectly leaking across conversations and rewriting prompt drafts, and (2) Markdown-derived tables being rendered twice due to unclear ownership between the Markdown renderer and the display-elements renderer.

Changes:

  • Introduces conversation-scoped upload state and a persistent attachment/progress status region in the chat composer.
  • Adds presentation.mode (notably inline_primary) and source-span metadata for Markdown-derived tables, plus renderer-side suppression logic to prevent duplicate table rendering while failing open when ownership can’t be proven.
  • Expands frontend and backend test coverage around attachment binding, upload coalescing, and display-element table ownership/validation.

Reviewed changes

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

Show a summary per file
File Description
tests/frontend/chatTabMarkdownRender.test.js Ensures Markdown tables don’t duplicate when display_elements includes inline-primary tables.
tests/frontend/chatDisplayElementOwnership.test.js Adds coverage for table ownership suppression vs augment rendering and raw-view fidelity.
tests/frontend/chatAttachmentWorkflowInput.test.js Adds tests for persistent attachment status, upload coalescing, and per-conversation upload isolation.
tests/backend/test_display_elements_service.py Adds backend tests for source-span correctness and validation around table presentation metadata.
src/frontend/web/von_interface/templates/chat_tab.html Adds a dedicated attachment status region in the composer and moves status output into it.
src/frontend/web/von_interface/static/styles.css Styles the new attachment status region and pending-attachment “pill” UI.
src/frontend/web/von_interface/static/js/chatTab.js Implements table presentation normalisation/suppression and conversation-scoped upload state + UI rendering.
src/backend/services/display_elements_service.py Preserves fence line positions for source spans and adds table presentation validation + emission.

Comment on lines +3765 to +3773
"presentation": {
"mode": "inline_primary",
"source_element_id": "screen_text",
"source_span": (
dict(source_span)
if isinstance(source_span, Mapping)
else {}
),
},
Comment on lines +12701 to +12707
const inlinePrimaryIds = new Set(inlinePrimaryCandidates);
return {
inlinePrimaryTableElements: inlinePrimaryCandidates,
appendedTableElements: tableElements.filter(
(tableElement) => !inlinePrimaryIds.has(tableElement)
)
};
@witbrock
witbrock merged commit 81d0626 into main Jul 27, 2026
5 checks passed
@witbrock
witbrock deleted the codex/JVNAUTOSCI-2605-2606-ui-fixes branch July 28, 2026 12:09
Sign up for free to 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.

2 participants