Skip to content

[Task] Extract layout side-effect controllers from layout.tsx #875

@Astro-Han

Description

@Astro-Han

Goal

Reduce the risk of packages/app/src/pages/layout.tsx by extracting the first non-visual side-effect controller boundary into focused layout modules, without changing the visible shell, sidebar DOM, routing behavior, storage keys, copy, aria labels, or command IDs.

This is a narrow execution slice under the broader frontend debt governance work. It is not a user-facing feature request.

Scope

In scope:

  • Extract update polling and SDK/desktop notification side effects from layout.tsx into focused modules or hooks under packages/app/src/pages/layout/.
  • Keep the public Layout component responsible for shell composition and prop wiring.
  • Preserve existing behavior for sidebar rows, session navigation, workspace switching, settings overlay, keyboard commands, and deep links.
  • Add focused tests only when extraction creates pure decision logic worth testing directly.

Out of scope:

  • No visual redesign.
  • No PawworkSidebar component split.
  • No TitleBar work.
  • No workspace lifecycle extraction.
  • No session window, prefetch, or navigation extraction.
  • No behavior changes to notifications, updates, deep links, commands, or routing.

Relevant files or context

Likely files:

  • packages/app/src/pages/layout.tsx
  • packages/app/src/pages/layout/*
  • packages/app/src/pages/layout/*.test.tsx
  • packages/app/src/pages/layout/*.test.ts
  • packages/app/e2e/sidebar*.spec.ts

Related issues:

Verification

  • Run the app typecheck.
  • Run targeted layout unit tests that cover the touched helpers/hooks.
  • Run focused sidebar/layout E2E coverage if the extraction touches route, sidebar, command, or workspace wiring.
  • Run a snap or manual shell check only if the visible rendered shell changes; this issue should avoid that.
  • Confirm git diff does not include unrelated UI copy, DOM structure, data attributes, aria labels, command IDs, or storage key changes.

Execution mode

Investigate and propose a plan first. The split plan is posted as an issue comment; implementation should wait for explicit maintainer approval or assignment before opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityappApplication behavior and product flowstaskNarrow execution, audit, spike, migration, tracking, or upstream follow-up worktech-debtSupplemental cleanup, maintainability, architecture, test, or quality debt contextuiDesign system and user interface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions