fix(components): preserve download dialog for HTML attachments - #342
fix(components): preserve download dialog for HTML attachments#342hasak21 wants to merge 1 commit into
Conversation
…I#321) Clicking an HTML file attachment uploaded via lody_upload_files with a workspace sourcePath previously short-circuited handlePreview into the live file viewer or browser connection, completely skipping SessionFilePreviewDialog. Because SessionFileCard has no separate download button, users had no way to download the attached HTML file bytes. Retain the in-app preview dialog for HTML attachments so that Download and Copy actions remain accessible. Add onOpenLivePreview to SessionFilePreviewDialog to provide a dedicated action to open the live preview when live provenance is present, and wire canOpenHtmlFile so the action is only shown when available. Model: gemini-3.8-flash
|
Hi @hasak21, I still can not see the dialog with download, could you check and attach a screenshot? |
|
Hi @Leeeon233, Thanks for reviewing! Here are the screenshots and a breakdown clarifying the behavior before and after this change: 1. Before (
|


Related issue
Closes #321
Problem / pressure
Clicking an HTML file attachment uploaded via
lody_upload_fileswith a workspacesourcePathshort-circuitedhandlePreviewdirectly into the live file viewer or browser connection, completely skippingSessionFilePreviewDialog. BecauseSessionFileCardhas no separate download button, users had no way to download the attached HTML file bytes.Summary
SessionFilePreviewDialogfor HTML file attachments so that Download and Copy actions remain accessible.onOpenLivePreviewtoSessionFilePreviewPanelandSessionFilePreviewDialogto provide a dedicated action to open the live preview when live provenance is present.canOpenHtmlFileviaSessionChatActionContextandSessionTurnListso the live preview action is only displayed when a live preview target is available.SessionFilePreviewPanelandSessionFilePreviewDialog.Before / after
sourcePathdirectly opened a file viewer tab or prompted to connect to a remote Browser port; the preview dialog with Download was never shown.SessionFilePreviewDialogwith Download and Copy buttons, plus a dedicated "Open live preview" button when a live preview target is available.Test plan
pnpm --filter @lody/components test tests/session-file-preview-dialog.test.tsx tests/session-html-attachment-action.test.ts(all 7 tests passed).pnpm --filter @lody/components typecheck(0 errors).pnpm check:quick(oxlint, lint:i18n, code-collab-imports, platform-boundaries, public-boundary all passed).pnpm formatto ensure clean formatting.Context handoff
Instructions for reviewing agents
SessionFileGroup.handlePreviewinview.tsxandonOpenLivePreviewinsession-file-preview-dialog.tsx.SessionFilePreviewDialogwith an explicit live preview action is the right model rather than changingSessionFileCardDOM structure.Authoring context
SessionFileCardor change how non-HTML previewable files render.resolveSessionHtmlAttachmentActionresolution logic, preserving existing local/remote resolution behavior.