DesignCard "Export" menu item has no onClick handler — click does nothing #132

Closed
opened 2026-10-03 03:58:17 +00:00 by Mark · 1 comment
Owner

Finding

src/components/gallery/DesignCard.tsx:278-281 — the "Export" menu item in the design card's dropdown menu has no onClick handler. Every other menu item is wired (Open in Workspace, Open in Editor, Rename, Duplicate, Move to Folder, Favorite, Delete). The user clicks "Export" and nothing happens.

This is the only "silent no-op" left in the DesignCard menu after the round 1 fixes that closed issues #111, #112, and others. The user is being offered a feature that doesn't work.

Where

src/components/gallery/DesignCard.tsx:278-281:

<DropdownMenuItem>
  <Download size={14} className="mr-2" />
  Export
</DropdownMenuItem>

Compare to the surrounding items, all of which have an onClick:

  • Line 228: onClick={() => onLoad(design)}
  • Line 232: onClick={() => onLoadInEditor?.(design)}
  • Line 246: onClick={() => onDuplicate(design)}
  • Line 272: onClick={() => onToggleFavorite(design.id)}
  • Line 284: onClick={() => onDelete(design)}

Suggested fix shape

Wire the Export menu item to open the export dialog for that specific design. Two paths:

  1. Use the existing ExportDialog from Workspace: navigate the user to the Workspace with the design loaded, then open the export dialog. The handleLoad callback in Gallery.tsx:531 already does the navigation; combining load + open-export is straightforward.

  2. Build a smaller export dialog inline in the Gallery: the user clicks Export, gets a modal with the same 4 formats from issue #129 (PES, DST, EXP, JEF), and downloads. No navigation needed. Cleaner UX but a new component.

Path 1 is the smaller change. The Workspace's ExportDialog is already in production. The Gallery just needs to route to it with the design pre-loaded.

Severity

High. A visible, clickable UI element that does nothing is the kind of dead-surface bug the user notices immediately.

Discovered by

Gap analysis (2026-10-02) of dead UI handlers in the Gallery.

  • #129 (open, triage-approved) — adds EXP and JEF to the export format list. The Export menu item fix should land EXP/JEF at the same time, not separately.
  • Round 1 fixes #111, #112 — closed several "click does nothing" bugs in the same area.
## Finding `src/components/gallery/DesignCard.tsx:278-281` — the "Export" menu item in the design card's dropdown menu has no `onClick` handler. Every other menu item is wired (Open in Workspace, Open in Editor, Rename, Duplicate, Move to Folder, Favorite, Delete). The user clicks "Export" and nothing happens. This is the only "silent no-op" left in the DesignCard menu after the round 1 fixes that closed issues #111, #112, and others. The user is being offered a feature that doesn't work. ## Where `src/components/gallery/DesignCard.tsx:278-281`: ```tsx <DropdownMenuItem> <Download size={14} className="mr-2" /> Export </DropdownMenuItem> ``` Compare to the surrounding items, all of which have an `onClick`: - Line 228: `onClick={() => onLoad(design)}` - Line 232: `onClick={() => onLoadInEditor?.(design)}` - Line 246: `onClick={() => onDuplicate(design)}` - Line 272: `onClick={() => onToggleFavorite(design.id)}` - Line 284: `onClick={() => onDelete(design)}` ## Suggested fix shape Wire the Export menu item to open the export dialog for that specific design. Two paths: 1. **Use the existing `ExportDialog` from Workspace**: navigate the user to the Workspace with the design loaded, then open the export dialog. The `handleLoad` callback in `Gallery.tsx:531` already does the navigation; combining load + open-export is straightforward. 2. **Build a smaller export dialog inline in the Gallery**: the user clicks Export, gets a modal with the same 4 formats from issue #129 (PES, DST, EXP, JEF), and downloads. No navigation needed. Cleaner UX but a new component. Path 1 is the smaller change. The Workspace's `ExportDialog` is already in production. The Gallery just needs to route to it with the design pre-loaded. ## Severity High. A visible, clickable UI element that does nothing is the kind of dead-surface bug the user notices immediately. ## Discovered by Gap analysis (2026-10-02) of dead UI handlers in the Gallery. ## Related - #129 (open, triage-approved) — adds EXP and JEF to the export format list. The Export menu item fix should land EXP/JEF at the same time, not separately. - Round 1 fixes #111, #112 — closed several "click does nothing" bugs in the same area.
Author
Owner

Closed by commit 1422ff2 on Mark/Kimi_Agent_Brother_10_Digitizing_App@main (origin/main).

The Export menu item in DesignCard.tsx (and the matching item in
RightClickMenu.tsx) is now wired to Gallery.handleExportDesign, which
piggybacks on the existing #74 "Open in Workspace" sessionStorage bridge
and navigates to /workspace with state.openExportOnLoad=true. Workspace's
freshly-mounted export-on-load effect waits for LOAD_DESIGN to dispatch
(appState must flip to 'digitized' and stitchObjects must populate — the
ExportDialog renders against live state), then dispatches SET_EXPORT_DIALOG
so the existing ExportDialog opens with the saved geometry in PES/DST/EXP/JEF
(#129). The flag is cleared via navigate(..., { replace: true }) so
subsequent renders / back-navs do not re-open the dialog.

Tests added:

  • src/pages/issue-132.test.tsx (4 cases on Workspace's export-on-load effect)
  • src/pages/issue-132-gallery.test.tsx (2 cases on Gallery's handleExportDesign)
  • src/pages/Workspace.test.tsx (extends the react-router mock with
    useLocation; default state=null so smoke tests stay unaffected)

Local verification: eslint clean on all changed files; tsc -b --noEmit
reports no new errors in the touched files (only pre-existing threadMatches
errors from #128); vitest shows 535 passing / 22 pre-existing unrelated
failures (same 22 that exist on main without this change); production
vite build clean. Forgejo Actions run #7406 is waiting on the self-hosted
runner at this writing — not a code issue, just CI substrate delay.

Closed by commit 1422ff2 on Mark/Kimi_Agent_Brother_10_Digitizing_App@main (origin/main). The Export menu item in DesignCard.tsx (and the matching item in RightClickMenu.tsx) is now wired to Gallery.handleExportDesign, which piggybacks on the existing #74 "Open in Workspace" sessionStorage bridge and navigates to /workspace with state.openExportOnLoad=true. Workspace's freshly-mounted export-on-load effect waits for LOAD_DESIGN to dispatch (appState must flip to 'digitized' and stitchObjects must populate — the ExportDialog renders against live state), then dispatches SET_EXPORT_DIALOG so the existing ExportDialog opens with the saved geometry in PES/DST/EXP/JEF (#129). The flag is cleared via navigate(..., { replace: true }) so subsequent renders / back-navs do not re-open the dialog. Tests added: - src/pages/issue-132.test.tsx (4 cases on Workspace's export-on-load effect) - src/pages/issue-132-gallery.test.tsx (2 cases on Gallery's handleExportDesign) - src/pages/Workspace.test.tsx (extends the react-router mock with useLocation; default state=null so smoke tests stay unaffected) Local verification: eslint clean on all changed files; tsc -b --noEmit reports no new errors in the touched files (only pre-existing threadMatches errors from #128); vitest shows 535 passing / 22 pre-existing unrelated failures (same 22 that exist on main without this change); production vite build clean. Forgejo Actions run #7406 is waiting on the self-hosted runner at this writing — not a code issue, just CI substrate delay.
Mark closed this issue 2026-10-03 04:32:06 +00:00
Sign in to join this conversation.
No description provided.