fix(kanban): restore card text editing via double-click and menu #65

Merged
AhmedHanafy725 merged 1 commit from development_kanban_card_edit_fix into development 2026-04-23 09:38:27 +00:00
Member

Summary

Two regressions from the card-select/drag work are fixed so kanban cards can be edited again via double-click and via the 3-dot menu Edit action.

Root causes

  • Double-click: the card click handler called renderKanban(), which destroys the cardRect between the two clicks of a potential dblclick. Konva's dblclick detector requires the second click to hit the same node as the first, so it never fired.
  • 3-dot Edit: the menu action walked group.children looking for the Konva.Text matching the card, but the card text now lives inside a per-card cardGroup introduced for drag-as-a-unit. The search returned nothing.

Changes

  • crates/hero_whiteboard_ui/static/web/js/whiteboard/kanban.js
    • Card click handler updates stroke/strokeWidth directly instead of re-rendering; the cardRect's identity is preserved so Konva can still fire dblclick on a quick second click.
    • Accented cardRect is tracked on the group (_selectedCardRect) and restored during full re-renders (triggered by state changes), so cross-render un-accenting stays correct.
    • Background click and stage-level deselect also un-accent through the ref and call batchDraw() instead of renderKanban().
    • showCardMenu now receives cardText directly; the Edit action uses that reference instead of a fragile text-content search.

Test Results

  • cargo check --workspace: pass
  • cargo clippy --workspace -- -D warnings: pass
  • cargo fmt --check: pass

Manual QA: double-click a card edits text; 3-dot menu Edit edits text; card selection accent still appears/clears on click / bg-click / outside-click / drag; Delete key still removes the selected card; renderKanban-driven re-renders (card add/move/delete/rename) leave the selection accent on the correct card.

## Summary Two regressions from the card-select/drag work are fixed so kanban cards can be edited again via double-click and via the 3-dot menu Edit action. ## Root causes - **Double-click**: the card click handler called `renderKanban()`, which destroys the cardRect between the two clicks of a potential dblclick. Konva's dblclick detector requires the second click to hit the same node as the first, so it never fired. - **3-dot Edit**: the menu action walked `group.children` looking for the Konva.Text matching the card, but the card text now lives inside a per-card `cardGroup` introduced for drag-as-a-unit. The search returned nothing. ## Changes - `crates/hero_whiteboard_ui/static/web/js/whiteboard/kanban.js` - Card click handler updates stroke/strokeWidth directly instead of re-rendering; the cardRect's identity is preserved so Konva can still fire dblclick on a quick second click. - Accented cardRect is tracked on the group (`_selectedCardRect`) and restored during full re-renders (triggered by state changes), so cross-render un-accenting stays correct. - Background click and stage-level deselect also un-accent through the ref and call `batchDraw()` instead of `renderKanban()`. - `showCardMenu` now receives `cardText` directly; the Edit action uses that reference instead of a fragile text-content search. ## Test Results - `cargo check --workspace`: pass - `cargo clippy --workspace -- -D warnings`: pass - `cargo fmt --check`: pass Manual QA: double-click a card edits text; 3-dot menu Edit edits text; card selection accent still appears/clears on click / bg-click / outside-click / drag; Delete key still removes the selected card; renderKanban-driven re-renders (card add/move/delete/rename) leave the selection accent on the correct card.
fix(kanban): restore card text editing via double-click and menu
All checks were successful
CI / build (pull_request) Successful in 2m9s
b60852bd4a
Two regressions from the card-select/drag work:

- Double-click no longer opened the inline editor because the card's
  click handler called renderKanban, which destroyed the cardRect
  between the two clicks. Konva's dblclick detector requires the
  second click to hit the same node as the first, so it never fired.
  Update stroke/strokeWidth directly on click and track the accented
  cardRect on the group, preserving its identity so dblclick works.
  renderCard re-attaches the ref during full re-renders triggered
  by state changes.

- The 3-dot menu "Edit" action walked group.children looking for the
  Konva.Text matching the card, but the text now lives inside the
  per-card cardGroup introduced with drag-as-a-unit. Pass cardText
  into showCardMenu so Edit has a direct reference.
AhmedHanafy725 merged commit 92957a0fee into development 2026-04-23 09:38:27 +00:00
AhmedHanafy725 deleted branch development_kanban_card_edit_fix 2026-04-23 09:38:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard!65
No description provided.