[PR #991] [MERGED] Feat: number list #4480

Closed
opened 2026-03-23 21:38:00 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/991
Author: @vincentdchan
Created: 9/6/2022
Status: Merged
Merged: 9/14/2022
Merged by: @LucasXu0

Base: mainHead: feat/number-list


📝 Commits (10+)

  • 565617d feat: recognize number
  • 69f04d0 feat: make following lines incremental
  • 2810097 feat: backspace
  • 875c109 feat: check previous node's number
  • 1736fb7 fix: unit test on number list
  • e223eec fix: selection after pasting nodes
  • 880669c feat: handle paste multi lines
  • c9b6e02 feat: add return value for copy paste handler
  • 002eac6 feat: handle paste number list
  • 0310b92 fix: dynamic width of the number

📊 Changes

9 files changed (+478 additions, -109 deletions)

View changed files

📝 frontend/app_flowy/packages/appflowy_editor/lib/src/operation/transaction_builder.dart (+5 -3)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart (+8 -7)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/backspace_handler.dart (+131 -42)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart (+66 -22)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart (+82 -24)
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/number_list_helper.dart (+38 -0)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/whitespace_handler.dart (+59 -0)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/undo_manager.dart (+13 -11)
frontend/app_flowy/packages/appflowy_editor/test/legacy/undo_manager_test.dart (+76 -0)

📄 Description

Merge after #903

This PR is implementing the number list in AppflowyEditor.

  1. Insert a line with numbered subtype(User press Enter to break a line):
    1. Make the number of this line is the successor of the previous line.
    2. Make the following lines’s number incremental.
  2. Delete a line with numbered subtype(User press Backspace to delete a line):
    1. Make the following lines’s number incremental.
  3. The user input number and press .:
    1. If the number provided by the user is the successor of the previous line:
      1. Turn this line into numbered subtype.
      2. Make the following lines’s number incremental.
    2. Otherwise, ignore it.
  4. The user press Backspace after the number:
    1. Make the following lines incremental from number 1

Indent/detent is not implemented yet.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/991 **Author:** [@vincentdchan](https://github.com/vincentdchan) **Created:** 9/6/2022 **Status:** ✅ Merged **Merged:** 9/14/2022 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `feat/number-list` --- ### 📝 Commits (10+) - [`565617d`](https://github.com/AppFlowy-IO/AppFlowy/commit/565617d1f0bdd5eaae8a2b08271e0ed4e05c20f9) feat: recognize number - [`69f04d0`](https://github.com/AppFlowy-IO/AppFlowy/commit/69f04d09580e627a7298201dd2ab624ac7547fca) feat: make following lines incremental - [`2810097`](https://github.com/AppFlowy-IO/AppFlowy/commit/2810097b956cebcfc9778e0ba60e18396cd52344) feat: backspace - [`875c109`](https://github.com/AppFlowy-IO/AppFlowy/commit/875c109b1406ad8453dda40cee1054113a1c502a) feat: check previous node's number - [`1736fb7`](https://github.com/AppFlowy-IO/AppFlowy/commit/1736fb794d2bff3af04fa9de971cae1d3d70f5b2) fix: unit test on number list - [`e223eec`](https://github.com/AppFlowy-IO/AppFlowy/commit/e223eecf325284f353b1ac8697e9722f2187ddc8) fix: selection after pasting nodes - [`880669c`](https://github.com/AppFlowy-IO/AppFlowy/commit/880669c0e501e9cb90621bcfb2a770b60d385400) feat: handle paste multi lines - [`c9b6e02`](https://github.com/AppFlowy-IO/AppFlowy/commit/c9b6e021670238801af41a59bc84d1713df8ae7b) feat: add return value for copy paste handler - [`002eac6`](https://github.com/AppFlowy-IO/AppFlowy/commit/002eac63f7febbf10311de1e4861441d1f3306e8) feat: handle paste number list - [`0310b92`](https://github.com/AppFlowy-IO/AppFlowy/commit/0310b92723801a0d9269a874d97444c923ab9eea) fix: dynamic width of the number ### 📊 Changes **9 files changed** (+478 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/operation/transaction_builder.dart` (+5 -3) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart` (+8 -7) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/backspace_handler.dart` (+131 -42) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart` (+66 -22) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart` (+82 -24) ➕ `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/number_list_helper.dart` (+38 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/whitespace_handler.dart` (+59 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/undo_manager.dart` (+13 -11) ➕ `frontend/app_flowy/packages/appflowy_editor/test/legacy/undo_manager_test.dart` (+76 -0) </details> ### 📄 Description Merge after #903 This PR is implementing the number list in AppflowyEditor. 1. Insert a line with numbered subtype(User press `Enter` to break a line): 1. Make the number of this line is the successor of the previous line. 2. Make the following lines’s number incremental. 2. Delete a line with numbered subtype(User press `Backspace` to delete a line): 1. Make the following lines’s number incremental. 3. The user input number and press `.`: 1. If the number provided by the user is the successor of the previous line: 1. Turn this line into numbered subtype. 2. Make the following lines’s number incremental. 2. Otherwise, ignore it. 4. The user press `Backspace` after the number: 1. Make the following lines incremental from number `1` Indent/detent is not implemented yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 21:38:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#4480
No description provided.