Skip to content

feat: support columns in marimo-pair#9212

Merged
mscolnick merged 1 commit intomainfrom
ms/columns-in-code-mode
Apr 16, 2026
Merged

feat: support columns in marimo-pair#9212
mscolnick merged 1 commit intomainfrom
ms/columns-in-code-mode

Conversation

@mscolnick
Copy link
Copy Markdown
Contributor

@mscolnick mscolnick commented Apr 15, 2026

Incoming transactions with set-config column updates only touched
cell.config.column metadata, leaving the MultiColumn tree unchanged
so boundary-anchor transactions never actually reorganized cells
across columns on the replica. Sort set-config changes last and
dispatch a new rebuildCellColumns action that regroups cells via
MultiColumn.fromIdsAndColumns using the reorder-cells flat order.

My smoke test:

  * Started with 2 cells "import marimo as mo" and `print(123)`
  1. Add a dataframe in the second column
  2. Add a chart above that as well
  3. Move the chart back to the first column
  4. Move the 123 cell to a 3rd column
  5. Add markdown headers above each column
``

Incoming transactions with set-config column updates only touched
cell.config.column metadata, leaving the MultiColumn tree unchanged
so boundary-anchor transactions never actually reorganized cells
across columns on the replica. Sort set-config changes last and
dispatch a new rebuildCellColumns action that regroups cells via
MultiColumn.fromIdsAndColumns using the reorder-cells flat order.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 15, 2026 9:31pm

Request Review

@mscolnick mscolnick marked this pull request as ready for review April 16, 2026 13:55
@mscolnick mscolnick requested review from Copilot and manzt and removed request for Copilot April 16, 2026 13:55
@mscolnick mscolnick added the enhancement New feature or request label Apr 16, 2026
@mscolnick mscolnick changed the title fix: rebuild column tree when applying set-config column changes feat: support columns in marimo-pair Apr 16, 2026
@mscolnick mscolnick requested a review from Copilot April 16, 2026 19:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds proper column-layout synchronization for marimo-pair replicas by ensuring incoming set-config column metadata updates are reflected in the MultiColumn tree (so cells physically move across columns, not just update metadata).

Changes:

  • Sort incoming transaction changes so set-config is applied after structural changes, then trigger a column-tree rebuild when column metadata changed.
  • Add a rebuildCellColumns reducer action that reconstructs MultiColumn from the flat order + each cell’s config.column.
  • Add targeted reducer and transaction-application tests covering boundary-anchor column conventions and ordering edge cases.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/src/core/cells/document-changes.ts Sorts set-config last during transaction application and dispatches rebuildCellColumns when column metadata changes.
frontend/src/core/cells/cells.ts Introduces rebuildCellColumns reducer action to rebuild the MultiColumn tree from config.column.
frontend/src/core/cells/tests/cells.test.ts Adds reducer-level tests for rebuildCellColumns behavior.
frontend/src/core/cells/tests/apply-transaction.test.ts Adds transaction-level tests verifying column rebuild behavior for boundary-anchor conventions and ordering variants.

Comment thread frontend/src/core/cells/document-changes.ts
Copy link
Copy Markdown
Collaborator

@manzt manzt left a comment

Choose a reason for hiding this comment

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

very nice

@mscolnick mscolnick merged commit 530fb6b into main Apr 16, 2026
41 of 43 checks passed
@mscolnick mscolnick deleted the ms/columns-in-code-mode branch April 16, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants