EditorRightPanel: ~170 lines of dead Sequence/Underlay branches + 4 smaller dead/broken controls #91
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where:
src/components/editor/EditorRightPanel.tsx.Bug: Walking the right panel turned up one large dead-section pair and four smaller issues. Same orphan-decorative-UI family as the Editor's Settings placeholder (#71, since fixed),
parseDesignFile.ts(#72), and the Settings page reference (#76).Bug 1 —
mode === 'sequence'(L257-335, ~80 lines) andmode === 'underlay'(L336-427, ~90 lines) branches are unreachable. ~170 lines of dead UI.The panel renders a different content per
mode(string). Of the four reachable toolbar modes (select_nodes,add_node,delete_node,convert_node,draw_path,scissors,smooth,zoom—TOOL_MODESinsrc/components/editor/constants.ts:28-37), onlyisNodeMode(the 6 listed node modes share one panel),draw_path, andzoomproduce content.sequenceandunderlayproduce no content because:EditorToolMode(src/components/editor/types.ts:38-46) does not include'sequence'or'underlay'— it enumerates exactly the 8 modes inTOOL_MODES.useState<EditorToolMode>('select_nodes')initializesmode(Editor.tsx:164);handleModeChange(Editor.tsx:204) only ever passes values from the toolbar (EditorToolbar.tsx:58-105mappingTOOL_MODES.map(tool => onModeChange(tool.id))) or from the keyboard shortcut toolMap (useKeyboardShortcuts.ts:89-104, keysn a d c p s m z→ the 8TOOL_MODES). Neither path can produce'sequence'or'underlay'.EditorRightPanel.tsx:9typesmodeasstring(relaxed fromEditorToolMode) so the comparison compiles. That relaxation is the only thing keeping the dead branches from being a TypeScript error.So the Sequence Controls panel (Play/Pause, Optimize Sequence button, drag-reorder list at L313-332) and the Underlay Settings panel (Main/Underlay toggle, disabled select + read-only inputs + disabled sliders at L373-422) never render in the running app. Grep:
All references are consumer-side: nothing ever sets
modeto'sequence'or'underlay'. The EditorCanvas branches (lines 292, 314, 325) are also unreachable for the same reason.Bug 2 — "Convert" button (L181) is mislabeled.
onClick={() => onUpdateNodeType('smooth')}— always sets node type to smooth. There's no conversion logic; the label promises "Convert" but the action is "force-smooth". The Node Type segmented control directly above (L147-160) already exposes corner/smooth/symmetric viaonUpdateNodeType(t), making this button redundant with the smooth segment.Bug 3 —
draw_pathPath Properties controls (L235-255) are uncontrolled dead-end inputs.Stitch Type and Density render with no
valueand noonChange—defaultValueonly. The user picks a different stitch type from the dropdown or moves the slider; the underlyingselectedPath.stitchTypeandselectedPath.densityare never updated. The export pipeline (pathsToStitchObjects, Editor.tsx:105-138) readsp.stitchType/p.densitydirectly from the path, so these controls visually change but have zero effect on the output.Bug 4 — Sequence Order list (L313-332) renders drag handles with no drag wiring.
GripVerticalicon at L319 withcursor: 'grab'. Nodraggableattribute, noonDragStart/onDragOver/onDragEndhandlers. The list is display-only. (Moot because the wholesequencemode branch is unreachable — Bug 1 — but if the mode were wired up, the drag handles would silently fail.)Bug 5 — EditorToolbar Settings button (EditorToolbar.tsx:149-163) is decorative-without-disabled. No
onClick, nodisabledprop. Hover changes background and color (onMouseEnter/onMouseLeavelines 152-160) — so the button looks interactive — but clicks do nothing. Same family as the EditorHeader Settings button (#71), but that one was fixed todisabled+cursor: not-allowed. EditorToolbar wasn't.Fix consistent with existing patterns:
Bugs 1 + 4 — delete or wire up. Two paths:
'sequence'and'underlay'branches fromEditorRightPanel.tsx(~170 lines). Drop theif (mode === 'underlay')/else if (mode === 'sequence')/else if (mode === 'underlay')branches fromEditorCanvas.tsx:289-340(~50 more lines). Re-tightenmode: EditorToolModeinEditorRightPanelProps. Then theunderlayEditModestate in Editor.tsx:173 becomes dead state (no UI ever flips it) — drop that too. Total ~250 lines of dead code removed.'sequence'and'underlay'toEditorToolMode+TOOL_MODES, expose them in the toolbar, give the keyboard shortcuts bindings. That's a feature request, not a bug fix — track separately under the open #6/#7/#8/#9/#10 Phase D issues or file a new "Editor needs explicit sequence/underlay tools" feature.Recommended: Delete. The actual sequence optimization happens server-side at export time; the per-path reorder would be a UX nicety at best.
Bug 2 — remove "Convert" button (L180-186) or make it round-robin. Three Node Type buttons already cover corner/smooth/symmetric. The button is redundant. If round-robin is desired, the handler is
onUpdateNodeType(nextType)wherenextType = current === 'corner' ? 'smooth' : current === 'smooth' ? 'symmetric' : 'corner'.Bug 3 — wire Stitch Type and Density to
selectedPath. Either:onStitchTypeChange/onDensityChangeprops toEditorRightPanelProps, lift the handlers toEditor.tsx, and callsetPaths(prev => prev.map(p => p.id === selectedPathId ? { ...p, stitchType, density } : p))— push history too.Bug 5 — disable the EditorToolbar Settings button (L149-163). Mirror the EditorHeader fix from #71:
With
disabled:opacity-30 disabled:cursor-not-allowedstyling to match the disabled Undo/Redo buttons above.Cross-references: #71 (EditorHeader Export/Settings no-op, since fixed), #76 (FAQ reference to non-existent Settings page, since fixed), #88 (orphan region-classifier, deferred+deleted this turn). Same orphan-UI pattern.
Severity: medium for Bug 1 (170 LOC of misleading UI + relaxed type), low for Bugs 2-5 (cosmetic / dead controls).
convert_nodeandscissorsare in the toolbar (TOOL_MODES) but EditorCanvas.tsx ignores them — picking them does nothing on the canvas (2 of 8 tools) #143