Skip to content

feat(app): delete Blocks (#5) - #21

Merged
rotespferd merged 3 commits into
mainfrom
feat/issue-5
Oct 20, 2026
Merged

rotespferd merged 3 commits into
mainfrom
feat/issue-5

Conversation

@rotespferd

Copy link
Copy Markdown
Contributor

Summary

 worksheet/reducer.ts
   WorksheetAction
+    { type: 'remove'; id }        # unknown id -> same state; clears selection if selected

 <Worksheet>
+  keydown Delete/Backspace       # removes selected Block unless focus is in a text-entry element
   <BlockHost>
+    <div.block-handle>           # left margin, vertically centered, visible on hover/selection
+      <button aria-label="Delete Block"> (trash icon)
     <View>

Closes #5

Evidence

  • Before: no way to remove a Block.
    After: reducer tests (remove: removes Block, clears selection, keeps selection for other Blocks, unknown id is a no-op) and component tests (handle button deletes, Delete/Backspace deletes only when text is not focused, last Block shows the empty-Worksheet hint again). pnpm typecheck, pnpm lint, pnpm test (67 tests) green.
  • Checked in a real browser against pnpm dev: Firefox (hover/selection visibility, no overlap with Block text, real mouse click, icon centered, handle centered next to 1-line and 4-line Blocks) and WebKitGTK (typing + Backspace keeps the Block, Delete without text focus removes it, button click removes it).
  • Not checked: dark-mode appearance of the handle.

Merge Danger

Door: two-way

Blast Radius: Worksheet Blocks only. There is no undo yet, so a deleted Block cannot be restored.

🤖 Generated with Claude Code

rotespferd and others added 3 commits October 20, 2026 12:41
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@rotespferd
rotespferd merged commit 170ba29 into main Oct 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: delete Blocks

1 participant