Skip to content

fix(Lists): unify indent and outdent for staircase selections#759

Draft
makhnatkin wants to merge 6 commits into
mainfrom
fix/sink-list-reverse-selection
Draft

fix(Lists): unify indent and outdent for staircase selections#759
makhnatkin wants to merge 6 commits into
mainfrom
fix/sink-list-reverse-selection

Conversation

@makhnatkin
Copy link
Copy Markdown
Collaborator

@makhnatkin makhnatkin commented May 17, 2025

This PR reworks list indentation around a shared block planner for complex multi-item list selections.

Instead of treating the whole selection as a single blockRange, the new logic plans contiguous sibling blocks per list level and applies the same model to both Tab / Mod-] and Shift-Tab / Mod-[.

The planner is now described and tested around six explicit cases:

  1. A single selected list item.
  2. A flat sibling group on one list level.
  3. A downward staircase selection into deeper nested items.
  4. An upward staircase selection from nested items back to outer siblings.
  5. A mixed multi-level selection that requires planner expansion and regrouping.
  6. A multi-block command that stays in one transaction and preserves selection on undo.

Behaviorally, this PR keeps block-based movement semantics:

  • the unit of movement is a contiguous sibling block, not an independently moved row;
  • the planner may expand the selected structure when nested tails are implied by the current selection;
  • indent and outdent share the same planning model and differ only in execution.

The test suite now covers the planner directly, and the Lists folder includes a short README with an algorithm diagram for future maintenance.

@gravity-ui-bot
Copy link
Copy Markdown
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Copy Markdown
Contributor

Visual Tests Report is ready.

@makhnatkin makhnatkin force-pushed the fix/sink-list-reverse-selection branch from 6d826aa to 4c1a0df Compare May 17, 2025 14:45
@makhnatkin makhnatkin force-pushed the fix/sink-list-reverse-selection branch from a30ab4e to 0147671 Compare May 29, 2025 21:45
@makhnatkin makhnatkin changed the title test: added test for list items with a reverse staircase selection test: rename me May 30, 2025
@makhnatkin makhnatkin changed the title test: rename me feat(List): rename me May 30, 2025
@makhnatkin makhnatkin force-pushed the fix/sink-list-reverse-selection branch from ccaef16 to 3eac1a7 Compare June 16, 2025 08:24
@makhnatkin makhnatkin changed the title feat(List): rename me fix(Lists): unify indent and outdent for staircase selections May 11, 2026
@makhnatkin makhnatkin force-pushed the fix/sink-list-reverse-selection branch from 3eac1a7 to cf6a479 Compare May 11, 2026 11:40
@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented May 11, 2026

Storybook Deployed

@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented May 11, 2026

🎭 Playwright Report

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.

2 participants