Skip to content

feat(webui): Sentinel Fleet Workbench shell and Bento Command Center (PR 1/2) - #1118

Merged
jatmn merged 3 commits into
mainfrom
feat/webui-sentinel-shell-command-center
Dec 3, 2026
Merged

jatmn merged 3 commits into
mainfrom
feat/webui-sentinel-shell-command-center

Conversation

@jatmn

@jatmn jatmn commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

PR 1 of 2 modernizing the jModGuard WebUI into the Sentinel Fleet Workbench (Option A + Option E hybrid) while carrying over jModGuard's existing Navy Dark and Ice-Blue Light brand tokens and WCAG AA contrast guarantees.

What changed

  • Sentinel Fleet Shell (frontend/app.js, frontend/style.css, frontend/controls.css):
    • Added a sticky top Telemetry Ribbon (.sf-ribbon) showing live workspace status, active server prefix, enabled/dry-run shield counts, enabled slash commands, routed log channels, and owner quick-jumps to Bot Resources and Database Usage.
    • Replaced the 224px 26-link sidebar with a compact 58px Server & Fleet Icon Rail (.sf-rail) for 1-click guild switching + an owner/system-admin Fleet shortcut, paired with 4 primary Workspace Hub pills (Command Center, Analytics, Configuration, Records, plus Fleet & Access when authorized) and a contextual #tabs sub-pill bar.
    • Preserved #guild-select (ServerPicker) inline in the header, role-based access control, preview mode read-only enforcement, and SVG-only iconography (frontend/icons.js).
    • Modernized tonal badges (color-mix fills), card elevation, and the Discord Sign-In landing view while keeping all :root / :root[data-theme="dark"] color tokens synchronized with crates/api/src/web/legal/style.css.
  • Bento Command Center (tabDashboard):
    • Upgraded the static dashboard into a live Bento Command Center: Overview stats strip + Enforcement Telemetry (30-day enforcement chart & UTC activity heatmap reusing useAnalyticsSummary with preview cache bypass and hidden-tab deferral) + Active Shields quick-control matrix with inline Off / Dry / Live rule toggles (PUT /api/guilds/{id}/rules/{rule_id} using captured enrollment_id and existing setSpamRuleMode / applyConfigPatch paths) + an owner-only Bot Infrastructure & Fleet Health strip (/api/database-usage & /api/owner/resources?range=24h, never rendered or requested for non-owners or previews).
    • Hardened tabEvents against missing state.config.event_types and cleared analyticsCache / ownerInfraCache on logout and auth loss.
  • Regression Coverage (scripts/frontend-state-test.mjs):
    • Updated shell, hub-navigation, and real headless Firefox WebDriver BiDi layout tests for the Sentinel Fleet Workbench.
    • Added tests for inline Off / Dry / Live shield controls, owner infrastructure strip isolation, and server/fleet rail switching.

Validation

  • npm run build --prefix tools/webui — PASS
  • bash tools/eslint-web-selftest.sh — PASS
  • node --test scripts/frontend-contrast-test.mjs scripts/frontend-sr-only-test.mjs scripts/frontend-warmup-test.mjs scripts/package-webui-test.mjs scripts/administration-state-test.mjs — 88/88 PASS
  • node --test scripts/frontend-state-test.mjs — 617/617 PASS (includes real headless Firefox BiDi desktop/mobile/font-scale layout suite; simulated API stub server)
  • git diff --check — clean

Stack

  • PR 1/2 (this PR): Shell + Telemetry Ribbon + Server/Fleet Rail + Bento Command Center + Analytics polish
  • PR 2/2 (stacked next): Zero-modal Master-Detail Configuration Workbench (Discord Preview ↔ Global Diff) + consolidated Records hub

Summary by Sourcery

Modernize the WebUI shell and dashboard into a Sentinel Fleet Workbench with role-aware navigation and a Bento Command Center.

New Features:

  • Replace the sidebar with a role-aware workspace hub navigation, compact server and fleet rail, and telemetry ribbon with status and configuration shortcuts.
  • Add a Command Center with enforcement trends, activity heatmap, and inline Off/Dry/Live shield controls for authorized users.
  • Show bot infrastructure and fleet health metrics in the Command Center for owners only.

Bug Fixes:

  • Avoid failures in the Events view when event type configuration is missing.
  • Clear cached analytics and owner infrastructure data on logout or authentication loss.

Enhancements:

  • Defer analytics loading while the document is hidden and prevent preview sessions from reusing or populating the analytics cache.
  • Refresh the Discord sign-in landing view and refine badges, cards, responsive layouts, and keyboard focus styling.

Tests:

  • Extend frontend state and browser layout coverage for hub navigation, server and fleet switching, shield controls, analytics, and owner-only infrastructure data.

@jatmn jatmn self-assigned this Dec 3, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The server rail can leave users on Fleet or push navigation down the mobile page, and Command Center can display another guild’s database usage.

Approach

The role-aware hubs reuse the existing tab permissions, and Command Center reuses the analytics and configuration APIs. The rail needs a server-workspace destination, and the database metric needs to follow the selected server’s storage placement.

Reviewed changes

  • Workspace shell. The telemetry ribbon, server and Fleet rail, and contextual hub navigation replace the sidebar. The sign-in page and shared badges get updated styling.
  • Command Center. The dashboard gains enforcement telemetry, inline shield modes, and an owner-only infrastructure strip. Analytics adds hidden-tab deferral and preview cache bypass.
  • Regression checks. State and Firefox layout tests cover the updated navigation and dashboard. GitHub’s frontend check passed, and 42 local contrast and warmup tests passed. The local screen-reader and browser checks require the WebUI build artifacts, which were missing from this checkout.

Non-blocking

  • Infrastructure samples appear current after they go stale. The strip reads once on mount and continues showing the numbers without a timestamp or stale indicator, even when the API already marks a retained sample stale. Show the sample’s freshness using the existing resource and database status fields. Infrastructure reads, resource freshness check, database stale status
  • The ribbon counts disabled rules as dry-run. Switching an enabled dry-run shield to Off preserves its dry_run setting, so the ribbon still counts it as dry while Active Shields shows Off. Count only shields whose effective mode is dry-run. Ribbon count, quick mode state

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol | 𝕏

Comment thread frontend/app.js Resolved
Comment thread frontend/style.css Resolved
Comment thread frontend/app.js Resolved
@jatmn
jatmn marked this pull request as ready for review December 3, 2026 01:50
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Sorry @jatmn, this account has used its review budget of 1,500,000 diff characters for the last 7 days.

You can request another review in 1 hour and 10 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Command Center can still show the wrong database on deployments with multiple shared stores.

Reviewed changes

Reviewed 83a307c against 9529e33. The WebUI build and four focused tests passed, including the Firefox layout test. GitHub’s frontend check also passed.

  • Restored server navigation. Server rail clicks from Fleet and owner pages open the selected server’s workspace, including when it was already selected.
  • Fixed the mobile rail. The mobile overrides now keep the server icons in one horizontal row.
  • Updated telemetry. The ribbon uses effective shield modes, and the owner strip uses database policy, resource scaling, and sample freshness fields.

Non-blocking

  • An unmeasured database triggers “Stale sample.” If the first probe fails, the API returns an unavailable row with no prior measurement. Reserve the stale badge for retained samples and let the database row show “Unavailable” for a failed first probe. Badge condition

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol | 𝕏

Comment thread frontend/app.js Resolved
…e for retained samples, and include onboarding expected state

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No blocking issues. The fleet peak can look complete when some stores have no measurement.

Reviewed changes

Reviewed 83a307c to 2213467. Syntax and whitespace checks passed, along with focused source probes for database selection and onboarding quick switches. The frontend CI check passed.

  • Replaced inferred guild placement with a fleet fallback. Command Center can select a store by placement ID when supplied. The current guild config response omits both placement fields, so the live UI uses the fleet fallback. Guild config response
  • Reserved the stale badge for retained samples. The smoke checks distinguish an unavailable first sample from a retained stale measurement, and the expanded state test covers both cases.
  • Updated onboarding trap quick switches. They send the previously loaded rule as expected and route Settings-only users to the editor when enabling live role removal requires Manage Server access.

Non-blocking

  • The fleet peak can understate database usage after a failed probe. When one store has no sample, the calculation drops that store and still labels the remaining maximum “Fleet DB peak.” If the unmeasured store is the fullest, owners see a lower figure with no indication that fleet coverage is partial. Label the value “Peak among measured stores” when coverage is incomplete. Fleet peak selection

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.2-sol | 𝕏

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