Summary
First of five pull requests splitting #1533 (the API docs page) so it can be reviewed in steps. The API docs reuse the Operations console's shell, so this one only moves that shell out of OperationsLayout into a shared ConsoleLayout. Nothing changes on screen.
Changes
ConsoleLayoutdraws the shell from its props: the sidebar of grouped pages, the header naming the current one, the mobile nav that scrolls sideways, the theme switch and the way back to /dev/null (a guest finds it on a phone too).OperationsLayoutkeeps what only Operations does (polling, refreshing, the remotes dock) and passes its pages in, with Moderation as an item elsewhere and prefetch off, as before.
Two options of ConsoleLayout are only used by the API docs, from #1643 on: links that prefetch (Operations leaves it off) and the way back for a guest on a phone (Operations only has signed-in admins). They are part of the shell, so they come with it, tested.
The stack, each opened as a draft until the one below it merges:
| # | Pull request | Depends on |
|---|---|---|
| 0 | this one | production |
| 1 | #1643 the API docs page and its Introduction | 0 |
| 2 | #1644 the guides | 1 |
| 3 | #1645 the OpenAPI spec | 2 |
| 4 | #1646 the endpoint reference and search | 3 |
Validation
| Check | Result |
|---|---|
TSX tests (tests/draft-images.config.ts) | 1117 passed, ConsoleLayout.test.tsx 12 |
tsc | clean |
vp fmt --check, vp lint | clean on the changed files |
No PHP changes.
Visual evidence
Playwright (Chromium) against a local dev server, emulated viewports. Operations was captured before (production) and after at 1440×900, 1366×650 and 390×844, light and dark, while this change was part of #1533; the pairs differ only in the pulsing live dot. The commit is unchanged since, only rebased.
| Before, 1440 light | After, 1440 light | Before, 390 dark | After, 390 dark |
|---|---|---|---|
Device verification
Emulation only (390×844, DPR 2, touch): no hardware or simulator.
Independent review
Fresh read-only reviewers, given the guidelines, the stack, the validation results and the captures. A first round on the previous heads found should-fix points (fixtures and options ahead of their PR, the Errors table hiding its meanings on a phone, the Guilds preview, captures from before production's guild fields), all fixed. Re-review on base 1aa85cf4, head 6e94300c: CODE: PASS, VISUAL: PASS, no blocker or should-fix. The Operations captures were checked against this exact layout code.
Limitations
None.
Summary by CodeRabbit
- New Features
- Added a responsive console interface with grouped navigation, active-page indicators, optional link prefetching, page headings, appearance controls, and header actions.
- Updated the operations interface to use the shared console navigation, including an external link to Moderation.
- Changes
- Operations navigation, branding, and return links now follow the shared console layout. Existing refresh controls, alerts, and chat access remain available.
No actionable comments were generated in the recent review.
Walkthrough
The change adds a reusable responsive console layout and updates the operations layout to use it. Unit tests cover the console layout’s navigation, branding, page content, prefetch settings, and user-aware links.
Changes: Console layout and operations integration
resources/js/layouts/console/layout.tsxresources/js/layouts/operations/layout.tsxConsoleLayout. Polling, manual refresh, remote hooks, and the conditional chat dock remain in the operations layout.tests/Unit/ConsoleLayout.test.tsxEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Possibly related issues
/api/v1and/api/cli. This PR adds shared console layout functionality, but does not add the OpenAPI documentation.Possibly related PRs
ConsoleLayoutextraction and its use by the operations layout.Suggested reviewers:
xheavenMerge Risk: Minimal · previous review
6e943This refactor moves the shared console shell into a reusable layout and keeps Operations-specific behavior in place. No concrete regression was found, and the new tests cover the shared layout's key behaviors. Merge risk is minimal.
Pre-merge checks: 4
Full details: Title check
Explanation
The title "refactor: extract the console layout from the operations layout" matches the main change. The PR adds ConsoleLayout in resources/js/layouts/console/layout.tsx and moves the shared shell out of OperationsLayout, which now delegates to it. The title is specific and concise, and it names the primary change without noise or vague terms.
Finishing Touches
Generate unit tests (beta)
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
8186432c-48da-41f8-9f45-b906d637ae57Reviewing files that changed from the base of the PR and between 6946cfb7195aba884e9e8c0aaa98342fcf5aa246 and 6e94300cedba77c438c3e5946667f00746d887ee.
resources/js/layouts/console/layout.tsxresources/js/layouts/operations/layout.tsxtests/Unit/ConsoleLayout.test.tsxIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.