Skip to content

Decide and document Tab/Shift+Tab semantics for Document blocks - #274

Merged
brylie merged 1 commit into
mainfrom
claude/github-issue-162-803418
Sep 12, 2026
Merged

Decide and document Tab/Shift+Tab semantics for Document blocks#274
brylie merged 1 commit into
mainfrom
claude/github-issue-162-803418

Conversation

@brylie

@brylie brylie commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

No code behavior changes — BlockEditor.svelte's handleKeydown already had no 'Tab' branch; this PR documents and pins that as a deliberate choice rather than an unexamined gap.

Test plan

  • npm run test (1283 tests passing)
  • npm run lint
  • npm run check

Closes #162

🤖 Generated with Claude Code

Tab already falls through BlockEditor's handleKeydown untouched, since
arrow-key navigation (#158) already meets the keyboard-only block-to-block
movement bar, and indent has no home in the data model without new
list-nesting support (out of 0.4.0's scope per the editor UX research
brief). Document the decision in rich-text-toolbar.md §5.5 and add a
regression test pinning that Tab/Shift+Tab are never intercepted, so the
choice stays intentional rather than reverting to an undocumented gap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

Or wait 24 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available. Your 38 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: bcc69f22-e3af-4cc5-b0a2-8fff2c39218b

📥 Commits

Reviewing files that changed from the base of the PR and between 41b1d22 and dc2fe42.

📒 Files selected for processing (2)
  • docs/specifications/rich-text-toolbar.md
  • src/routes/space/[spaceId]/doc/[id]/page.svelte.test.ts

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document and test native Tab behavior in block editors

📝 Documentation 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Documents native Tab/Shift+Tab focus semantics for rich-text document blocks.
• Adds regression coverage ensuring BlockEditor never prevents either keyboard event.
• Defers list indentation until the data model supports nested content.
Diagram

graph TD
  SPEC["Keyboard spec"] -. documents .-> EDITOR["Block editor"] --> BROWSER["Native focus"] --> CONTROLS["Block controls"]
  TEST["Regression test"] -. verifies .-> EDITOR
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Intercept Tab for block navigation
  • ➕ Could provide direct editor-to-editor movement.
  • ➕ Would create an explicit application-controlled navigation path.
  • ➖ Duplicates existing ArrowUp and ArrowDown block navigation.
  • ➖ Would bypass or complicate access to other focusable block controls.
  • ➖ Overrides established browser focus expectations.
2. Implement list indentation
  • ➕ Matches familiar outline and word-processor conventions.
  • ➕ Could support nested list authoring in the future.
  • ➖ Requires new nested-content semantics in WorkspaceRecord and ViewConfig.
  • ➖ Introduces substantial persistence, collaboration, rendering, and migration scope.
  • ➖ Exceeds the current editor research scope.
3. Add an explicit Tab no-op branch
  • ➕ Makes the decision visible directly in the keyboard handler.
  • ➖ Unnecessary branching may imply BlockEditor owns native Tab behavior.
  • ➖ Documentation and regression coverage already express and enforce the contract.

Recommendation: Keep the PR’s native-focus approach. It preserves access to all row controls, avoids duplicating arrow-key navigation, and defers indentation until nested content receives a deliberate data-model design.

Files changed (2) +53 / -0

Tests (1) +40 / -0
page.svelte.test.tsPin non-interception of Tab keyboard events +40/-0

Pin non-interception of Tab keyboard events

• Adds a regression test confirming that neither Tab nor Shift+Tab is prevented inside a block editor. The test also records jsdom’s limitation that native focus movement is not simulated.

src/routes/space/[spaceId]/doc/[id]/page.svelte.test.ts

Documentation (1) +13 / -0
rich-text-toolbar.mdDefine native Tab and Shift+Tab semantics +13/-0

Define native Tab and Shift+Tab semantics

• Documents that block editors deliberately leave Tab and Shift+Tab to browser focus order. It explains why block navigation and list indentation were rejected for the current scope.

docs/specifications/rich-text-toolbar.md

@brylie
brylie merged commit 0d18945 into main Sep 12, 2026
2 checks passed
@brylie
brylie deleted the claude/github-issue-162-803418 branch September 12, 2026 18:28
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.

Decide and implement Tab/Shift+Tab semantics for Document blocks

1 participant