Skip to content

fix(shortcut): now user can increase the size of text using command#14922

Open
ZAKIURREHMAN wants to merge 2 commits into
toeverything:canaryfrom
ZAKIURREHMAN:increase/text-size
Open

fix(shortcut): now user can increase the size of text using command#14922
ZAKIURREHMAN wants to merge 2 commits into
toeverything:canaryfrom
ZAKIURREHMAN:increase/text-size

Conversation

@ZAKIURREHMAN
Copy link
Copy Markdown

@ZAKIURREHMAN ZAKIURREHMAN commented May 7, 2026

now user can increase the size of text using command +option +[, as well decrease. #14838

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcuts (Mod-Alt-[ and Mod-Alt-]) to increase or decrease paragraph heading levels quickly and efficiently.
    • Multi-selection support enables batch adjustments to heading levels across multiple selected blocks simultaneously.
    • Heading levels cycle seamlessly between text and h1–h6 heading styles, providing flexible formatting options.

@ZAKIURREHMAN ZAKIURREHMAN requested a review from a team as a code owner May 7, 2026 09:09
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

NoteKeymap adds a new private helper _changeHeadingLevel that adjusts selected paragraph blocks' heading types (text, h1–h6) in either direction with wrapping. Two hotkeys (Mod-Alt-[ and Mod-Alt-]) register to trigger the helper and prevent default browser behavior.

Changes

Heading Level Adjustment

Layer / File(s) Summary
Helper Implementation
blocksuite/affine/blocks/note/src/note-keymap.ts
New private _changeHeadingLevel(direction) method filters selected blocks to eligible paragraphs, computes next heading type with wrapping (text ↔ h1–h6), and applies changes via single updateBlockType command.
Hotkey Wiring
blocksuite/affine/blocks/note/src/note-keymap.ts
Two hotkeys (Mod-Alt-[ and Mod-Alt-]) registered to invoke _changeHeadingLevel with direction parameter and prevent default.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions increasing text size via command, but the actual change adds heading level adjustment (text/h1-h6 cycling) via Mod-Alt-[ and Mod-Alt-], not text size changes. Update the title to accurately reflect the feature: e.g., 'feat(shortcut): add keyboard shortcuts to change paragraph heading levels' or similar, to match the actual implementation.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@blocksuite/affine/blocks/note/src/note-keymap.ts`:
- Around line 250-257: The command currently applies a single props.type
(updates[0].nextType) to all selected blocks, overriding per-block computations;
change the payload so each selected block carries its own props with its
computed nextType. Specifically, replace the single props field and simple
selectedBlocks array with a selectedBlocks array of objects like {
blockComponent: u.blockComponent, props: { type: u.nextType } } (constructed
from updates.map(...)) when calling
this._std.command.chain().pipe(updateBlockType, ...), so updateBlockType
receives per-block props instead of a global props.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5921c5dc-9f72-410d-80d3-25848a62cbd6

📥 Commits

Reviewing files that changed from the base of the PR and between 5813e7d and c750d82.

📒 Files selected for processing (1)
  • blocksuite/affine/blocks/note/src/note-keymap.ts

Comment thread blocksuite/affine/blocks/note/src/note-keymap.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant