Skip to content

fix(console): mount canonical canvas pages - #147

Merged
Travis-Gilbert merged 1 commit into
mainfrom
fix/data-model-empty-canonical
Jul 31, 2026
Merged

fix(console): mount canonical canvas pages#147
Travis-Gilbert merged 1 commit into
mainfrom
fix/data-model-empty-canonical

Conversation

@Travis-Gilbert

@Travis-Gilbert Travis-Gilbert commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • wire /program to a durable console-program registry surface
  • let canonical Model and Program canvas pages own their internal chrome
  • migrate existing near-complete server layouts and cached layouts without repopulating intentionally sparse layouts
  • add route, seed, migration, and rendered browser acceptance coverage

Verification

  • pnpm --filter @commonplace/console lint (0 errors; 9 pre-existing warnings)
  • pnpm --filter @commonplace/console test (118 files passed; 507 tests passed)
  • pnpm --filter @commonplace/console gates
  • pnpm --filter @commonplace/console build:railway
  • focused Playwright Program route acceptance (1 passed)

Summary by CodeRabbit

  • New Features

    • Added a dedicated Program Canvas at /program.
    • Added Program Canvas navigation and workspace support.
    • Updated the Models editor to use a streamlined, bare layout.
  • Bug Fixes

    • Improved layout migration and synchronization so canvas views retain their intended structure and appearance.
  • Tests

    • Added coverage verifying Program Canvas routing, loading, and layout migration behavior.

Copilot AI review requested due to automatic review settings July 31, 2026 21:37
@ecc-tools

ecc-tools Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@Travis-Gilbert
Travis-Gilbert merged commit 638c9ed into main Jul 31, 2026
7 of 10 checks passed
@Travis-Gilbert
Travis-Gilbert deleted the fix/data-model-empty-canonical branch July 31, 2026 21:37
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96addf23-a4a8-4eae-b28d-cf674488c278

📥 Commits

Reviewing files that changed from the base of the PR and between 2dbd8f3 and a5c7275.

📒 Files selected for processing (8)
  • apps/console/e2e/console-sidebar.spec.ts
  • apps/console/e2e/global-setup.ts
  • apps/console/src/components/shell/EditorTabs.tsx
  • apps/console/src/lib/console-host.test.ts
  • apps/console/src/lib/console-host.ts
  • apps/console/src/lib/surface-routes.ts
  • apps/console/src/lib/view-routing-retirement.test.ts
  • apps/console/src/lib/workspace-seed.ts

📝 Walkthrough

Walkthrough

The console now seeds a canonical Program Canvas surface, migrates existing layouts to bare canvas chrome, maps /program to console-program, and validates route activation and canvas rendering.

Changes

Program Canvas integration

Layer / File(s) Summary
Program surface seed and chrome contract
apps/console/src/lib/workspace-seed.ts
Adds Program surface and view identifiers, seeds the Program layout, and updates Models editor chrome to bare revision 2.
Canvas layout hydration and server adoption
apps/console/src/lib/console-host.ts, apps/console/src/lib/console-host.test.ts
Canonicalizes canvas regions, persists migration actions, creates missing Program objects, and verifies the migrated layout.
Program route, shell rendering, and coverage
apps/console/src/lib/surface-routes.ts, apps/console/src/lib/view-routing-retirement.test.ts, apps/console/src/components/shell/EditorTabs.tsx, apps/console/e2e/*
Maps /program to console-program, passes bare chrome to ViewInstanceHost, prewarms the route, and verifies Program Canvas rendering.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant SurfaceRoutes
  participant ConsoleHost
  participant ConsoleShell
  participant ProgramCanvas
  Browser->>SurfaceRoutes: request /program
  SurfaceRoutes->>ConsoleShell: activate console-program
  ConsoleShell->>ConsoleHost: load canonical layout
  ConsoleHost->>ConsoleShell: provide Program view and bare chrome
  ConsoleShell->>ProgramCanvas: render program.canvas
Loading

Possibly related PRs

Suggested reviewers: copilot, cursoragent

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/data-model-empty-canonical

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

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.

Pull request overview

This PR mounts a new canonical Program canvas page as a durable console surface, updates routing to treat it as a page-owned surface, and migrates older persisted layouts so canonical canvas pages don’t get wrapped in extra shell chrome.

Changes:

  • Add a seeded console-program surface (with program.canvas view instance) and include it in workspace seed + host migration paths.
  • Extend surface routing and routing-retirement tests to map console-program/program.
  • Update shell rendering so editor regions with chrome: 'bare' can render view instances without an extra BlockShell, plus add E2E coverage for the /program route.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/console/src/lib/workspace-seed.ts Adds seeded Program surface/view-instance and marks canonical canvas editor regions as chrome: 'bare'.
apps/console/src/lib/view-routing-retirement.test.ts Extends route ↔ surface-id mapping expectations for /program.
apps/console/src/lib/surface-routes.ts Registers /program as a page-owned auxiliary surface route.
apps/console/src/lib/console-host.ts Migrates persisted layouts to chrome: 'bare' for canonical canvas pages and writes through updates for durable layouts.
apps/console/src/lib/console-host.test.ts Adds regression coverage for Program surface seeding and server-layout migration behavior.
apps/console/src/components/shell/EditorTabs.tsx Passes bare rendering mode to ViewInstanceHost when a single-tab editor region is marked chrome: 'bare'.
apps/console/e2e/global-setup.ts Prewarms /program route and includes it in shell-route readiness checks.
apps/console/e2e/console-sidebar.spec.ts Adds Playwright acceptance that /program mounts console-program and renders the program canvas.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copy link
Copy Markdown

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: a5c7275100

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<ViewInstanceHost
instance={active}
host={host}
bare={bare && region.properties.chrome === 'bare'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve bare chrome when canvas regions gain another tab

When a user adds a palette block or moves another view into the Models or Program editor, instances.length becomes greater than one, so this expression passes bare={false} even though the persisted region still declares chrome: 'bare'. Returning to the canonical canvas tab then wraps ProgramView or ModelView in the generic BlockShell again; ProgramView already renders its own BlockShell, producing the duplicate chrome this change is intended to remove. Keep tab-strip visibility separate from whether the region's view bodies are rendered bare.

Useful? React with 👍 / 👎.

Comment on lines 631 to 632
const shouldFillMissing =
missing.length > 0 && durable.length >= Math.ceil(seed.length / 2);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require stronger evidence before repopulating sparse layouts

For any server layout containing the primary surface and landmarks, having only half of the current seed objects is enough to classify it as near-complete and recreate every missing surface, region, and view instance over HTTP. A deliberately reduced layout just above this cutoff is therefore expanded with almost half a seed, despite the adjacent contract saying sparse remotes must be adopted as-is; use a revision or known prior-seed signature rather than raw object count before modifying the durable arrangement.

AGENTS.md reference: apps/console/AGENTS.md:L153-L158

Useful? React with 👍 / 👎.

Comment on lines +641 to +642
if (additions.length > 0) {
await this.pushMissingSeedObjects(additions);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reattach missing seed nodes to surviving parents

When a near-complete server layout is missing only a region or view instance while its seeded parent still exists, additions excludes that parent and this call creates only the missing node. pushMissingSeedObjects emits containment moves solely by iterating children of the objects it receives, while replaceLayout also leaves the surviving parent's old child list unchanged, so the recreated node remains orphaned and the surface still cannot render it. This also prevents recovery after a partially successful earlier seed push; derive the required parent-to-child moves from the full seed graph rather than only from additions.

AGENTS.md reference: apps/console/AGENTS.md:L153-L158

Useful? React with 👍 / 👎.

Comment on lines +313 to +315
layoutObject(PROGRAM_SURFACE_ID, 'surface', {
name: 'Program', kind: 'program', role: 'place', active: false, seed_revision: 1,
}, ['program.region-editor', ...companionIds('program')]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Navigate when selecting the new Program layout

The new Program surface is exposed in LayoutSwitcher because all seeded surfaces are passed to it, but LayoutSwitcher.switchTo only calls host.activateSurface and never navigates to the newly registered /program path. Selecting Program from the Layouts menu therefore leaves the previous URL in place; on reload, IntuiShell treats that pathname as authoritative and reactivates the previous surface, so the Program selection is lost. Route this new layout option through pathForSurfaceId and the router, as the launch-place navigation does.

Useful? React with 👍 / 👎.

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