Skip to content

Different line style#14920

Open
ZAKIURREHMAN wants to merge 2 commits into
toeverything:canaryfrom
ZAKIURREHMAN:different/style-line
Open

Different line style#14920
ZAKIURREHMAN wants to merge 2 commits into
toeverything:canaryfrom
ZAKIURREHMAN:different/style-line

Conversation

@ZAKIURREHMAN
Copy link
Copy Markdown

@ZAKIURREHMAN ZAKIURREHMAN commented May 7, 2026

when user click on the backslach button then click on the devider here show multple styles of line. #14900

Summary by CodeRabbit

  • New Features
    • Dividers now support multiple configurable styles: solid, dotted, dashed, loosely-dashed, and lines.
    • Added a style selection submenu in the slash menu for quick access to divider style options.

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

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds support for configurable divider styles. Divider blocks now accept a type property (solid, dotted, dashed, loosely-dashed, or lines), applied via dynamic border rendering. Users select styles through a slash menu submenu that triggers the block-type command, which creates dividers with the selected style.

Changes

Configurable divider styles

Layer / File(s) Summary
Divider type definitions and schema
blocksuite/affine/model/src/blocks/divider/divider-model.ts
Exports DividerType and DividerProps types; updates DividerBlockSchema props typing and DividerBlockModel generic parameter to use DividerProps.
Component rendering with dynamic styles
blocksuite/affine/blocks/divider/src/divider-block.ts
Imports styleMap directive; computes borderTopStyleMap for each type variant; renders container with type-specific CSS class and data-type attribute; binds <hr> style from computed hrStyle.
Block type command with prop passing
blocksuite/affine/blocks/note/src/commands/block-type.ts
Updates updateBlockType to pass props (defaulting to {}) when creating affine:divider blocks, enabling divider creation with inherited type properties.
Slash menu style selection
blocksuite/affine/blocks/note/src/configs/slash-menu.ts
Imports SlashMenuContext; separates quote handling from divider logic; creates divider submenu with style options; each selection dispatches updateBlockType with flavour: 'affine:divider' and the selected type.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Different line style' directly summarizes the main feature: adding support for multiple divider line styles, which is the primary change across all modified files.

✏️ 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.

@ZAKIURREHMAN ZAKIURREHMAN changed the title Different/style line Different style line May 7, 2026
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.

🧹 Nitpick comments (1)
blocksuite/affine/blocks/note/src/configs/slash-menu.ts (1)

75-80: ⚡ Quick win

Centralize divider type literals to avoid drift.

The type list at Lines 75–80 duplicates model/renderer values. Please source these from a shared constant/type module so menu options cannot diverge from supported values.

🤖 Prompt for 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.

In `@blocksuite/affine/blocks/note/src/configs/slash-menu.ts` around lines 75 -
80, Summary: The inline list of divider type literals in slash-menu.ts
duplicates model/renderer values and should be sourced from a shared constant to
avoid drift. Fix: import the shared divider constant (e.g., DIVIDER_TYPES or
DIVIDER_STYLES) from the central constants/type module and replace the
hard-coded array in slash-menu.ts with a map over that imported constant (use
the same property names like label and type), ensuring the produced menu entries
use the canonical type values; update any local label mapping if the shared
shape differs and run related tests.
🤖 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.

Nitpick comments:
In `@blocksuite/affine/blocks/note/src/configs/slash-menu.ts`:
- Around line 75-80: Summary: The inline list of divider type literals in
slash-menu.ts duplicates model/renderer values and should be sourced from a
shared constant to avoid drift. Fix: import the shared divider constant (e.g.,
DIVIDER_TYPES or DIVIDER_STYLES) from the central constants/type module and
replace the hard-coded array in slash-menu.ts with a map over that imported
constant (use the same property names like label and type), ensuring the
produced menu entries use the canonical type values; update any local label
mapping if the shared shape differs and run related tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef51bff4-eaea-412a-b7ee-75b24e453335

📥 Commits

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

📒 Files selected for processing (4)
  • blocksuite/affine/blocks/divider/src/divider-block.ts
  • blocksuite/affine/blocks/note/src/commands/block-type.ts
  • blocksuite/affine/blocks/note/src/configs/slash-menu.ts
  • blocksuite/affine/model/src/blocks/divider/divider-model.ts

@ZAKIURREHMAN ZAKIURREHMAN changed the title Different style line Different line style May 7, 2026
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