Skip to content

refactor: extract the console layout from the operations layout - #1642

Open
jubianchi wants to merge 1 commit into
dev-null-sh:productionfrom
jubianchi:refactor/console-layout
Open

jubianchi wants to merge 1 commit into
dev-null-sh:productionfrom
jubianchi:refactor/console-layout

Conversation

@jubianchi

@jubianchi jubianchi commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. ConsoleLayout draws 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).
  2. OperationsLayout keeps 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
Operations before, desktop, light Operations after, desktop, light Operations before, mobile, dark Operations after, mobile, 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.

The API docs page reuses the operations console's shell: 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.

ConsoleLayout now draws that shell from its props: the brand chip and
label, the nav landmark's own label, whether its links prefetch, and a
title that falls back to the console's name. OperationsLayout keeps
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. Nothing changes on screen: captures before and after
differ only in the pulsing live dot.

Two things only the API docs will use come with it, as part of the
shell: links that prefetch, which operations leaves off, and the way
back for a guest on a phone, since operations only has signed-in
admins.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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

Layer / File(s) Summary
Build the shared console shell
resources/js/layouts/console/layout.tsx
Adds navigation types and a responsive console layout with grouped navigation, branding, page headings, optional header actions, appearance controls, and user-aware return links.
Adopt the shared shell in operations
resources/js/layouts/operations/layout.tsx
Passes operations navigation and page controls to ConsoleLayout. Polling, manual refresh, remote hooks, and the conditional chat dock remain in the operations layout.
Verify shared layout behavior
tests/Unit/ConsoleLayout.test.tsx
Adds tests for branding, navigation states, prefetching, external links, headings, header actions, content, and guest or member back links.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related issues

Possibly related PRs

Suggested reviewers: xheaven

Merge Risk: Minimal · up to 6e943

This 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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8186432c-48da-41f8-9f45-b906d637ae57
Commits

Reviewing files that changed from the base of the PR and between 6946cfb and 6e94300.

Files selected for processing: 3

  • resources/js/layouts/console/layout.tsx
  • resources/js/layouts/operations/layout.tsx
  • tests/Unit/ConsoleLayout.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

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.

1 participant