Skip to content

Refactor builder panels into unified simple/advanced architecture - #52

Open
a5sh wants to merge 1 commit into
mainfrom
codex/refactor-builder-architecture-and-layout-p7dx6a
Open

Refactor builder panels into unified simple/advanced architecture#52
a5sh wants to merge 1 commit into
mainfrom
codex/refactor-builder-architecture-and-layout-p7dx6a

Conversation

@a5sh

@a5sh a5sh commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Unify the duplicated builder implementations so /build and /abuild share a single, maintainable shell and avoid divergent/ghost code.
  • Modularise left/right subpanels so each subpanel can live in its own file and reuse common primitives like the layer/inspector UI.
  • Reduce boilerplate and make the panel header / switcher UI consistent across simple and advanced modes.

Description

  • Replaced the old separate advanced app by removing src/components/builder/AdvancedBuilderApp.tsx and routing advanced behavior through the shared BuilderApp in src/components/builder/index.tsx (unified /abuild to render BuilderApp).
  • Introduced a persistent builder mode toggle and type: added BuilderMode in src/components/builder/types.ts, a header BuilderModeToggle component at src/components/builder/components/navigation/BuilderModeToggle.tsx, and localStorage-backed mode selection in the builder shell (builderMode).
  • Extracted and standardised horizontal panel switching into PanelSwitcher (src/components/builder/components/navigation/PanelSwitcher.tsx) and rewired the LayerPanel and Inspector to consume it; added mode, hideTabBar and side props to LayerPanel so it can be embedded as a subpanel.
  • Implemented an advanced panel system: AdvancedPanelList (left panel list) and AdvancedPanelRenderer (right-side renderer) in src/components/builder/panels/, and thin wrapper entry files for each subpanel (panels/left/* and panels/right/*) so badges, selection, source, layers and poster logic are modularized.
  • Reworked Inspector to use the new panel components (BadgesPanel / SelectionPanel) when appropriate; refactored EditorContext to export type TabType for reuse across new modules.
  • Removed the support CTA (coffee/support button) from the builder header and replaced it with the BuilderModeToggle UI.
  • Project reorganization: created components/builder/components/navigation/, components/builder/panels/, and split/rewired large files so panels are self-contained and easier to maintain.

Testing

  • npm run build completed successfully (Astro/Vite client build finished) ✅.
  • npm run typecheck (tsc --noEmit) surfaced pre-existing TypeScript issues unrelated to this refactor (failures in src/components/admin/AnalyticsDashboard.tsx, src/components/admin/TestBenchmark.tsx, and other files); typecheck did not pass end-to-end due to those repository-wide issues ⚠️.
  • npm run test (Vitest) reported no test files configured; no unit tests were run (no test files present) ⚠️.
  • Manual UI verification: launched dev server and captured a screenshot using Playwright; initial screenshot run required installing Playwright browsers and OS deps, after npx playwright install and required system packages, a screenshot of http://localhost:4321/build was successfully taken (npx playwright screenshot --viewport-size=1440,1000 ...) ✅.
  • Code formatting: ran prettier --write on the new/modified builder files (formatted TS/TSX); Prettier reported it could not infer a parser for the .astro wrapper file during the run (non-blocking) ⚠️.

If anything in the new panel shape or toggle behavior should be adjusted (different default mode, alternative layout, or further splitting of very large components), I can follow up with additional smaller PRs to iterate on those specific areas.


Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
posterium-frontend a329018 Commit Preview URL

Branch Preview URL
May 08 2026, 06:15 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant