Skip to content

refactor(ui-react): block-main layout and EmptyState splash#6395

Merged
gustavosbarreto merged 2 commits into
masterfrom
refactor/ui-react/full-bleed-layout
Jun 1, 2026
Merged

refactor(ui-react): block-main layout and EmptyState splash#6395
gustavosbarreto merged 2 commits into
masterfrom
refactor/ui-react/full-bleed-layout

Conversation

@luizhf42
Copy link
Copy Markdown
Member

@luizhf42 luizhf42 commented Jun 1, 2026

What

Reworks the console page <main> into a block scroll container, then extracts the full-page splash screen — duplicated across seven onboarding/empty/locked/gated states — into a single shared EmptyState component.

Why

Two problems, the first enabling the second:

  1. The old <main> was a flex column with overflow-y-auto. A scrollable flex container drops its padding-bottom in Chrome, so page content was clipped flush against the bottom edge with no padding.
  2. The same splash markup (a centered card over a full-bleed decorative background, an optional feature grid, and a CTA) was copy-pasted across seven sites with divergent, ad-hoc implementations, each carrying a fragile min-h-[calc(100vh-3.5rem)] height hack to escape the layout.

Changes

  • layout: <main> is now a plain block, absolutely positioned inside a relative size-full wrapper — its own scroll container, which honors p-8 pb-4. It wraps only the routed <Outlet>; the decorative grid-bg moves to a sibling. AppLayout and AdminLayout share the identical structure, dropping the flex-1 flex flex-col min-h-0 chain pages used to inherit.
  • EmptyState: new component (icon, overline, title, description, accent, optional features/footnote, children CTA slot) that owns the full-bleed background. Web Endpoints, Public Keys, Firewall Rules, Secure Vault (empty + locked), and admin Unauthorized migrate to it; FeatureGate delegates to it. The per-page calc() and negative-margin hacks are gone.
  • accessibility: splash CTAs that lacked a focus-visible ring now have one; the splash renders a real <h1> named via aria-labelledby and a <ul> feature list.
  • WelcomeScreen: adapted to the block <main> (min-h-full, since flex-1 is now inert); kept separate as the richer dashboard hero.
  • minor visual standardization: Web Endpoints' lone cyan accent orb is unified to blue, and the icon-badge shadow is now consistent across splashes.

Testing

EmptyState.test.tsx covers rendering, accent variants, the feature list, and the aria-labelledby wiring. Manually: open each migrated page in its empty state (clear/lock Secure Vault for both states; view a gated FeatureGate page on a CE build; hit admin Unauthorized as a non-admin). Confirm the centered card, full-bleed background, working CTAs, correct accent, and — the original bug — no bottom clipping. Also load a populated page to confirm normal content still renders correctly under the reworked <main>.

@luizhf42 luizhf42 requested a review from a team as a code owner June 1, 2026 17:39
@luizhf42 luizhf42 self-assigned this Jun 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Claude finished @luizhf42's task in 1m 3s —— View job


Code Review Complete

Reviewed 11 files. 2 inline issues posted (1 high, 1 medium).

Both stem from the same root cause: <main> changed from a flex container to a block scroll container (absolute inset-0 overflow-y-auto), which breaks pages that rely on flex-1 to fill available height. Adding flex flex-col back to <main> in both layouts preserves the block-layout fix for padding/scrolling while keeping flex-item growth working for child pages.

  • AppLayout.tsx (high): BannerEdit.tsx's textarea collapses to intrinsic height (~2 rows) because its flex-1 chain no longer has a flex parent.
  • AdminLayout.tsx (medium): Loading/error states in Dashboard, SessionDetails, and License lose vertical centering for the same reason.

If you've addressed the feedback and want a new review, tag @shellhub-io/admin and a team member can trigger it.

Comment thread ui-react/apps/console/src/components/layout/AppLayout.tsx
Comment thread ui-react/apps/console/src/components/layout/AdminLayout.tsx
luizhf42 added 2 commits June 1, 2026 15:08
The page `<main>` was a flex column with `overflow-y-auto`. A scrollable
flex container drops its `padding-bottom` in Chrome, so page content was
clipped flush against the bottom edge with no padding.

Rework AppLayout and AdminLayout so `<main>` is a plain block absolutely
positioned inside a `relative size-full` wrapper — its own scroll container,
which honors `p-8 pb-4`. `<main>` now wraps only the routed `<Outlet>`, with
the decorative grid-bg as a sibling, so the element has proper semantics.
This also drops the `flex-1 flex flex-col min-h-0` chain pages inherited.

WelcomeScreen fills with `min-h-full`; the old `flex-1` is inert under a
block `<main>`.
The full-page onboarding / empty / locked / gated splash was duplicated with
ad-hoc markup across Web Endpoints, Public Keys, Firewall Rules, Secure Vault
(empty + locked), the admin Unauthorized page, and `FeatureGate`: a centered
card over a full-bleed decorative background, an optional feature grid, and a
call-to-action.

Extract it into one `EmptyState` component — props for icon, overline, title,
description, `accent`, optional `features` and `footnote`, plus a `children`
CTA slot — and migrate every call site to it; `FeatureGate` now delegates to
it as well. The component owns the full-bleed background, removing the
per-page `min-h-[calc(100vh-3.5rem)]` and negative-margin hacks.

This also closes a11y gaps surfaced by the consolidation: a `focus-visible`
ring on the CTAs that lacked one, a real heading named via `aria-labelledby`,
and the feature list marked up as a `<ul>`. Web Endpoints' lone cyan accent
orb is unified to blue to match the others.
@luizhf42 luizhf42 force-pushed the refactor/ui-react/full-bleed-layout branch from b8f114d to 5bc83c6 Compare June 1, 2026 18:09
@gustavosbarreto
Copy link
Copy Markdown
Member

/review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Claude finished @gustavosbarreto's task in 10s —— View job


Code Review Complete

Reviewed 16 files across code quality, security, testing, language patterns, and architecture — no issues found. The code looks good as-is.

If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.


@gustavosbarreto gustavosbarreto merged commit f1eb8d2 into master Jun 1, 2026
17 checks passed
@gustavosbarreto gustavosbarreto deleted the refactor/ui-react/full-bleed-layout branch June 1, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants