Skip to content

SD-2527 - feat: implement new types of ordered lists#2873

Open
chittolinag wants to merge 18 commits intomainfrom
feat/SD-2527
Open

SD-2527 - feat: implement new types of ordered lists#2873
chittolinag wants to merge 18 commits intomainfrom
feat/SD-2527

Conversation

@chittolinag
Copy link
Copy Markdown
Contributor

@chittolinag chittolinag commented Apr 20, 2026

Introducing new types of ordered lists:

  1. number with bracket
  2. uppercase roman
  3. uppercase alpha
  4. lowercase roman
  5. lowercase alpha
  6. alpha with bracket

Even though we supported rendering the styles when opening documents from Word, the user couldn't start a new list using these types.

This PR introduces a dropdown that allows the user to do so.

Note

This PR depends on #2857. Let's merge the other one first.

Screenshot 2026-04-20 at 15 59 36

@linear
Copy link
Copy Markdown

linear Bot commented Apr 20, 2026

@chittolinag chittolinag changed the title SD-2527 - Implement new types of ordered lists SD-2527 - feat: implement new types of ordered lists Apr 20, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chittolinag chittolinag marked this pull request as ready for review April 20, 2026 19:43
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 038936be5a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/super-editor/src/editors/v1/extensions/paragraph/paragraph.js Outdated
chittolinag and others added 3 commits April 27, 2026 14:58
… (SD-2527)

Coverage for the 10 styles this PR introduces (3 bullet + 7 ordered):
- Unit: full mapping matrix for markerTextToBulletStyle and
  numberingInfoToOrderedStyle, plus the BULLET_STYLE_CHARS and
  ORDERED_LIST_STYLES override branches in numbering-transforms.
- Unit: style param threading through toggleList, including the
  same-style-toggle-off and different-style-create cases.
- Unit: headless toolbar deriver values for all 10 styles plus
  documented null cases (upper-alpha-paren, decimalZero, prefixed).
- Unit: registry rename compatibility (legacy toggleBulletList /
  toggleOrderedList no longer flows through bullet-list/numbered-list).
- Behavior: each toggle command produces correct OOXML and locks in
  current partial-selection style-switch fragmentation behavior.
- Visual: fixture spec for sd-2527-list-styles.docx (auto-discovered).
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

hey @chittolinag! nicely scoped :)

i pushed a follow-up (c2685a3) with tests for all 10 styles - unit + behavior + visual, all passing.

three things inline. one more small thing: the bullet menu and the numbered menu return different shapes when you read their state - bullets give you the character (), numbered gives you the name (decimal-paren). worth lining up.

needs work.

role="menuitem"
:aria-label="button.ariaLabel"
ref="buttonRefs"
@keydown.prevent="(event) => handleKeyDown(event, index)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

.prevent blocks every key, so Tab, Escape, and Space all stop working inside the menu. same fix in NumberedStyleButtons.vue:86.

Suggested change
@keydown.prevent="(event) => handleKeyDown(event, index)"
@keydown="(event) => handleKeyDown(event, index)"

then call event.preventDefault() inside the cases the switch handles.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same comment as here: #2857 (comment)

Comment thread packages/super-editor/src/editors/v1/core/commands/toggleList.js
@chittolinag chittolinag requested a review from a team as a code owner April 29, 2026 20:19
chittolina and others added 3 commits April 29, 2026 21:53
Resolve conflicts between SD-2527 (ordered list styles + abstract-mutation
for whole-list restyling) and SD-2526 (bullet style picker + split button).

Behavior decisions:
- SD-2527's abstract-mutation gate wins for bullet style swaps too: caret in
  one item now restyles every sibling at the same (numId, ilvl), preserving
  list identity and continuous numbering. SD-2526's "swap mints a new numId"
  tests updated to assert the new whole-level semantics.
- Kept SD-2526's `bulletStyleLevel` plumbing on `generateNewListDefinition`
  so the create path still lands the override at the paragraph's existing
  nesting level when the abstract gate doesn't apply.
- Extended the split-button toolbar pattern to the numbered list dropdown
  for parity with bullets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@luccas-harbour
Copy link
Copy Markdown
Contributor

luccas-harbour commented Apr 30, 2026

hey @chittolina! I gave this one a quick pass and found these:

  1. When the cursor is at a line that contains a numbered list, the toolbar used to show the numbered list icon with a darker background. I see that this is not the case anymore but it is what Microsoft Word does, might be worth having a look?
  • Perhaps you could use the segmented button you implemented for bullet lists here too?
  1. I noticed that if I create a numbered list with 2 items and then, while the cursor is in the second item, I deselect the numbered list toolbar button, it removes the numbering from both items and not just from the one where the cursor was (which is Word's behavior)

@chittolinag
Copy link
Copy Markdown
Contributor Author

chittolinag commented May 1, 2026

hey @chittolina! I gave this one a quick pass and found these:

  1. When the cursor is at a line that contains a numbered list, the toolbar used to show the numbered list icon with a darker background. I see that this is not the case anymore but it is what Microsoft Word does, might be worth having a look?
  • Perhaps you could use the segmented button you implemented for bullet lists here too?
  1. I noticed that if I create a numbered list with 2 items and then, while the cursor is in the second item, I deselect the numbered list toolbar button, it removes the numbering from both items and not just from the one where the cursor was (which is Word's behavior)

hey @chittolina! I gave this one a quick pass and found these:

  1. When the cursor is at a line that contains a numbered list, the toolbar used to show the numbered list icon with a darker background. I see that this is not the case anymore but it is what Microsoft Word does, might be worth having a look?
  • Perhaps you could use the segmented button you implemented for bullet lists here too?
  1. I noticed that if I create a numbered list with 2 items and then, while the cursor is in the second item, I deselect the numbered list toolbar button, it removes the numbering from both items and not just from the one where the cursor was (which is Word's behavior)

@luccas-harbour , thanks for the feedback. the 1st issue if fixed. the 2nd, I spoke to Missy and we decided to follow this approach:

  1. if the user has an empty selection and changes the list style (or toggles the list off by clicking the left-side action in the segmented button), it will be applied to the entire list (items at the same level).
  2. if the user has a non empty selection and executes the same actions as above, it will be applied inline, ie, only to the selected item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants