kanban improvements #220
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_whiteboard#220
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?
basically work heavily on visualization of kanban and usability
make sure all of features are in openrpc
Implementation Spec for Issue #220 — Kanban improvements
Objective
Substantially improve the kanban board's visualization and usability. The card (the item dragged on the board) becomes a structured "story" with a title, a rich markdown description (can be large), simple tags, and a deadline. The current inline title-only edit is replaced by a dedicated story editor modal. On the board itself, the description is intelligently truncated to fit the card and scales with card/column size. Deadlines render in a status-aware color, tags render small. Cross-column drag-and-drop is verified/hardened so all fields move with the card. Every new field is reflected in OpenRPC.
Requirements
deadline, shown in a distinct color (overdue = red, due-soon = amber, otherwise neutral).tags(array of strings), shown small as chips.openrpc.json(KanbanCard schema + card.add / card.update params, with merge semantics).Card data model (stored in BoardObject.data.columns[].cards[] — free JSON, no SQL migration)
text: string(existing) — card title.description: string(new) — markdown body, may be large; default empty.deadline: string(new) — ISOYYYY-MM-DDor empty.tags: string[](new) — short labels; default empty.Files to Modify/Create
crates/hero_whiteboard_server/src/handlers/kanban.rs—card_addandcard_updateaccept optionaldescription,deadline,tags;card_updatebecomes a partial merge (only provided fields change); defensive validation; new unit tests.crates/hero_whiteboard_server/openrpc.json— extendKanbanCardschema andkanban.card.add/kanban.card.updateparams with the new fields; document merge semantics. (Confine edits to kanban regions; file has unrelated uncommitted edits.)crates/hero_whiteboard_admin/static/web/js/whiteboard/markdown.js— addtruncateForPreview(markdown, maxChars)helper (sentence/word-boundary cut, trailing …); export it.crates/hero_whiteboard_admin/static/web/js/whiteboard/kanban.js— render title + truncated description + tag chips + deadline badge on the Konva card; open the story editor modal on card click; harden cross-column DnD; preserve new fields on all mutations.crates/hero_whiteboard_admin/static/web/js/whiteboard/kanban_editor.js(NEW) — the story editor modal: title input, tags editor, deadline picker, markdown textarea with Write/Preview tabs (live preview via WhiteboardMarkdown.toHtml), Save/Cancel; integrates with WhiteboardHistory snapshot + persist.crates/hero_whiteboard_admin/static/web/css/whiteboard.css— story editor modal styles (centered overlay, dimmed backdrop) and card chip/badge styles.crates/hero_whiteboard_admin/templates/*(whichever loads the kanban JS) — add a<script>tag for the newkanban_editor.js.SPECIFICATIONS.md— document the new card shape and deadline color thresholds.Implementation Plan
Step 1: Extend the card data model on the server
Files:
crates/hero_whiteboard_server/src/handlers/kanban.rscard_add: read optionaldescription(string),deadline(string),tags(string array) in addition to requiredtext; include them in the pushed card object when present.card_update: maketext,description,deadline,tagsall optional; write each to the existing card only when provided (merge, mirroringcolumn_update).validate_columns: still requirecard["text"]to be a string; when present, validatedescriptionis string,deadlineis string,tagsis an array of strings.card_updatepreserves other fields;card_addwith all fields;card_movepreservesdescription/deadline/tags.Dependencies: none.
Step 2: Update the OpenRPC schema
Files:
crates/hero_whiteboard_server/openrpc.jsonKanbanCardschema: adddescription(string),deadline(string),tags(array of string) with descriptions.kanban.card.addparams: add optionaldescription,deadline,tags.kanban.card.updateparams: maketextoptional; add optionaldescription,deadline,tags; update method description to state partial/merge semantics.kanban.card.movedescription that all card fields move with the card.Dependencies: field names must match Step 1.
Step 3: Markdown truncation helper
Files:
crates/hero_whiteboard_admin/static/web/js/whiteboard/markdown.jstruncateForPreview(markdown, maxChars): strip heavy block syntax (code fences, images), cut at the last sentence boundary (. ! ?) at/under maxChars, else last word boundary, append … when truncated; keep light inline markdown. Export in the public API object.Dependencies: none (parallel with Steps 1–2).
Step 4: Story editor modal (NEW)
Files:
crates/hero_whiteboard_admin/static/web/js/whiteboard/kanban_editor.js,crates/hero_whiteboard_admin/static/web/css/whiteboard.css, the kanban templateWhiteboardMarkdown.toHtml). Footer: Cancel / Save. Esc cancels, Cmd/Ctrl+Enter saves.WhiteboardKanbanEditor.open(card, onSave)(or similar). On save it calls back with the edited{text, description, deadline, tags}; kanban.js wires that to snapshot + mutate + persist.<script>include for kanban_editor.js to the template that already loads kanban.js/markdown.js.Dependencies: Step 3 (preview reuses markdown renderer).
Step 5: Render structured card body and open the editor on click
Files:
crates/hero_whiteboard_admin/static/web/js/whiteboard/kanban.jstext) + optionaldescription/tags/deadline. Compute card height to fit: title + truncated description block + tag chip row + deadline badge. Derive description char budget from column width and zoom so larger cards show more (usestruncateForPreview).DEADLINE_SOON_DAYS = 2(overdue red #dc3545, soon amber #f59e0b, else neutral).WhiteboardKanbanEditor.open(...); on save doWhiteboardHistory.snapshotBefore, apply fields,renderKanban,persistKanbanMutation. (Keep a lightweight path for the existing menu actions.)Dependencies: Steps 3 and 4.
Step 6: Harden cross-column drag-and-drop
Files:
crates/hero_whiteboard_admin/static/web/js/whiteboard/kanban.jscardGroupdragstart/dragend logic still computes target column (pointer X) and insert index (Y) correctly with the new variable-height cards (reads_colLayout). Re-test intra-column reorder and cross-column moves with tall description/tag/deadline cards.Dependencies: Step 5 (variable heights).
Step 7: Documentation
Files:
SPECIFICATIONS.md{ text, description?, deadline?, tags? }, deadline color thresholds, and tag format.Dependencies: Steps 1–6.
Acceptance Criteria
description(markdown),deadline(ISO date), andtags(string array) throughkanban.card.add/kanban.card.update, sync save/load, and server persistence.openrpc.jsonKanbanCard schema and card.add / card.update params includedescription,deadline,tags; card.update documents merge semantics.cargo test -p hero_whiteboard_serverpasses including new kanban tests.Notes
mindmap.js+.mm-note-*CSS) is the closest existing reference for canvas markdown rendering and a DOM markdown popup; reuse its patterns for consistency, but the kanban editor is a larger centered modal (not the small note popup).sync.js) deep-clones the whole columns array both directions, so new card fields persist with no sync.js changes; servercard_movemoves whole card objects, so fields travel automatically.openrpc.json,mindmap.rs, and some templates already have unrelated uncommitted changes ondevelopment; confine kanban edits to kanban regions.Test Results
cargo test -p hero_whiteboard_server(finished in 2m 45s build + 0.20s run).New kanban handler tests for #220:
card_add_stores_description_deadline_and_tags— passedcard_update_partial_preserves_other_fields— passedcard_move_preserves_rich_fields— passedAll pre-existing kanban, mindmap, and object handler tests continue to pass.
Frontend JS syntax check (
node --check) on kanban.js, kanban_editor.js, markdown.js: passed.