#1642

refactor: extract the console layout from the operations layout

Openjubianchiwants to merge intofrom

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 requestDepends on
0this oneproduction
1#1643 the API docs page and its Introduction0
2#1644 the guides1
3#1645 the OpenAPI spec2
4#1646 the endpoint reference and search3

Validation

CheckResult
TSX tests (tests/draft-images.config.ts)1117 passed, ConsoleLayout.test.tsx 12
tscclean
vp fmt --check, vp lintclean 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 lightAfter, 1440 lightBefore, 390 darkAfter, 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.

Activity

2
coderabbitai[bot]13d ago

IMPORTANT

Review skipped

Review was skipped as selected files did not have any reviewable changes.

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: a56edc87-74d0-4eb6-99cc-e3a875ce1e33
Commits

Reviewing files that changed from the base of the PR and between eb22e8c8cfefd9535d39f9467de0b4ac31621aae and bffa6b3440ac2d82ff661f693762281ea2748e06.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

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

  • dev-null-sh/dev-null.sh#857 — Requests OpenAPI documentation for /api/v1 and /api/cli. This PR adds shared console layout functionality, but does not add the OpenAPI documentation.

Possibly related PRs

Suggested reviewers: xheaven

Merge Risk: Minimal · previous review 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: 4

Check nameStatusExplanation
Title checkThe 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 checkCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkCheck skipped because no linked issues were found for this pull request.
Description CheckCheck skipped - CodeRabbit’s high-level summary is enabled.
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 6946cfb7195aba884e9e8c0aaa98342fcf5aa246 and 6e94300cedba77c438c3e5946667f00746d887ee.

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.