PR2 of Context lifecycle: drop MainCheckout, add root_branch + source #52

Manually merged
atanabe merged 1 commit from feat/052-pr2-of-context-lifecycle-drop-maincheckout-add into master 2026-06-30 02:00:00 +02:00
Owner

PR2 of Context lifecycle: drop MainCheckout, add root_branch + source

Touches 23 files: CLAUDE.md, ck-testing-e2e/src/harness.rs, ckeditor-lint/baseline.toml, ckeditor-lint/baseline_CHANGELOG.md, ckeditor/src/app_layout/context_switch.rs, ckeditor/src/app_layout/dashboard_dispatch.rs and 17 more.

PR2 of Context lifecycle: drop MainCheckout, add root_branch + source Touches 23 files: `CLAUDE.md`, `ck-testing-e2e/src/harness.rs`, `ckeditor-lint/baseline.toml`, `ckeditor-lint/baseline_CHANGELOG.md`, `ckeditor/src/app_layout/context_switch.rs`, `ckeditor/src/app_layout/dashboard_dispatch.rs` and 17 more.
cmwangi requested changes 2026-06-30 01:55:00 +02:00
Dismissed
cmwangi left a comment

Mostly there, but the question on ckeditor/src/app_layout/dashboard_dispatch.rs needs an answer before this lands.

Mostly there, but the question on `ckeditor/src/app_layout/dashboard_dispatch.rs` needs an answer before this lands.
@ -220,0 +233,4 @@
// truth for `root_branch`; the command is their entry point. Returns
// None when the command doesn't match either form so the caller falls
// through to the next dispatcher.
fn try_root_branch_command(
Owner

try_root_branch_command reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?

`try_root_branch_command` reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?
cmwangi approved these changes 2026-06-30 01:55:00 +02:00
cmwangi left a comment

Good. The second pass on ckeditor/src/app_layout/dashboard_dispatch.rs is what I hoped for.

Good. The second pass on `ckeditor/src/app_layout/dashboard_dispatch.rs` is what I hoped for.
Author
Owner

Split. The decision in try_root_branch_command is a pure function now, with its own tests in ckeditor/src/app_layout/dashboard_dispatch.rs.

Split. The decision in `try_root_branch_command` is a pure function now, with its own tests in `ckeditor/src/app_layout/dashboard_dispatch.rs`.
Author
Owner

Updated. The point about ckeditor/src/app_layout/dashboard_dispatch.rs turned out to be a real bug, so thank you.

Updated. The point about `ckeditor/src/app_layout/dashboard_dispatch.rs` turned out to be a real bug, so thank you.
Drops `ContextKind::MainCheckout`. Every Context is a worktree.
Replaces `Project.default_branch` with a user-set `Project.root_branch`
discovered via `master > main > root > dev > current HEAD`, overridable
through `:root-branch <name>`. Adds `Context.source` (defaults to
`root_branch` on spawn and on hydrate-time backfill). Startup on a
protected branch with no restorable Context lands on the dashboard
rather than auto-creating a main-checkout.

`is_protected` lives as a free function in `project` so the
`{root_branch} ∪ protected_branches` union is reusable from
`delete_context` and the spawn invariant without raising the type's
RFC. The PR1-era dirty-main switch guard is gone (worktrees own their
own working tree, so switches never touch the main repo). `promote` /
`demote` are gone with `MainCheckout`. Older meta.json carrying
`default_branch` migrates silently into `root_branch` on the next load.

Tests, scenarios, harness, and the architecture doc updated to match.
The harness gains `activate_root_context(name)` so the two scenarios
that previously relied on the auto-MainCheckout layout
(`create_edit_save_close_round_trip`, `open_file_via_tree_keys`) can
explicitly materialize a Context rooted at the project directory.
Lifecycle plan §8 marks PR2 ✅.
atanabe manually merged commit eff69ae061 into master 2026-06-30 02:00:00 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
northgale/ckeditor!52
No description provided.