fix(layout): make the console usable on mobile

Approval required
GU
2d ago
+1918-927

Preview only. This PR is split for review into #3257 (shared components) and #3258 (page layouts, stacked on #3257). Review and merge those two; this one stays open to serve the preview and will be closed once they are merged.

Summary

Issue: no ticket

On a phone the console rendered at 712px and was cut off on every page. The cause is min-width: 44.5rem on body in main.scss. This PR removes it, along with the two workarounds that reset it on the auth page and the onboarding and the WarningScreenMobile component, and fixes the pages that still overflowed at 390px:

  • Header: Feedback is hidden below md, AI Copilot shows its icon only (label kept for screen readers), and the breadcrumb trail scrolls to the current scope instead of shrinking it to zero width.
  • Settings layouts (organization, cluster, project, environment, service): the side nav stacks above the form. Before, forms got about 150px.
  • Service, environment and cluster headers, variables toolbar, service logs toolbar, instances summary: wrap below md.
  • Audit logs: below md the table keeps timestamp, event and target; the details stay one tap away. The user, source and target type filters live in the hidden column headers, so phones only filter by date and event.
  • Cluster list and new service picker: one column on phones.
  • Cluster node pools (overview): each card stacks name and description, then CPU, memory and nodes as full-width rows. Before, four 25% columns broke descriptions one word per line. The expanded nodes table scrolls horizontally.
  • Cluster resources settings: node pool details and the disk IOPS/throughput inputs go to one column. Same for the subnet lists in network settings, the KEDA scaler fields, the VPC mode cards and the service remove modal.
  • Role edit matrix: scrolls horizontally, with a static header below md so it no longer covers the first row.
  • Side navigation (all settings, alerts, service monitoring): below md it collapses behind a button showing the current section, so the form is visible without scrolling past the links.
  • Organization settings pages: the primary action button sits under the title instead of on top of it; list rows (credentials, registries, git tokens, helm repositories, webhooks) wrap long values and keep their actions visible. 16px side padding on all settings, danger zone and creation flow pages.
  • Breadcrumbs: the current scope takes the free space (at least 8rem) and the trail scrolls to its start; scrolled-off parents fade out.
  • Logs: deployment and pre-check log lines put the message under the line number and timestamp at full width; log headers and the stage step bar wrap.
  • Dense tables (advanced settings, health checks, role matrix, nodes): scroll horizontally on phones.
  • Banners, deployment header, cloud shell toolbar, monitoring toolbar, auto-deploy row, error page: wrap or shrink instead of overflowing.
  • Touch screens (pointer: coarse / hover: none, desktop unchanged): fields use 16px text so iOS Safari no longer zooms in on focus; no auto-focus (the keyboard no longer covers half of a freshly opened modal); copy buttons that only appeared on hover are always visible; buttons and checkboxes get an invisible halo so their tap area reaches about 40px; double-tap zoom delay removed; modal scroll no longer chains to the page.
  • Full-height views (chart, variable, Dockerfile and values modals, log panels): 100dvh instead of 100vh, so their bottom edge is no longer hidden under the mobile browser toolbar.
  • Data tables on phones (priority columns: the key columns stay, secondary ones are hidden below md, desktop unchanged): environment service list (name, status, actions), environments table (name, actions), variables (name, value, actions), deployment lists for services, environments and clusters (date, status), members (name, role), cluster workloads (environment, pods, CPU, memory), external secrets (name, actions), agentic workflow runs (date, status), ArgoCD services (service, actions).
  • Copilot stop button and log row link: the stop action is shown directly on touch screens, and copying a log row link shows a check instead of happening silently.
  • Sticky Save on mobile: in 24 long settings forms the action row (Save) sticks to the bottom of the screen below md, in the thumb zone, and returns to its place at the end of the form. Shared classes live in libs/shared/ui/src/lib/utils/mobile-layout.ts.
  • Search on phones: the Spotlight trigger becomes a search icon below md (it was hidden), and the command menu fits the screen.
  • Tooltips and popovers on touch: tooltips open on tap; popovers no longer focus their search field on open, so the keyboard does not cover them; the service icon picker fits the screen and scrolls.
  • Horizontal scroll hints: the tab bar keeps the active tab in view, and tab bars and wide tables fade the edge that hides more content (shared useHorizontalOverflowFade in util-hooks, applied below md only).
  • Tap targets: small buttons reach 44px on touch screens (invisible halo, no visual change).
  • Modal: max-width: calc(100vw - 32px). The create environment modal was 488px wide.

Hidden columns are keyed on column ids or per-cell classes, never on positions. Every layout change uses max-md:, a md: override or a touch media query, so desktop renders the same. A few changes apply everywhere but have no visible effect at desktop widths: the modal max-width and overscroll-contain, the tooltip collisionPadding and max-width, and relative on ButtonPrimitive and Checkbox for the tap halo.

Screenshots / Recordings

Open the preview on a phone (or browser devtools at 390px): https://3241-console-staging.zc531a994.rustrocks.cloud

Testing

Playwright with mobile emulation at 390x844, logged in with the E2E token against production data. Checked that scrollWidth stays at 390 and that nothing sticks out of the viewport outside scroll containers, on 20 pages: org overview, clusters, cluster overview and settings, audit logs, org settings and members, project overview and settings, environment overview, variables and settings, service overview, deployments, logs, variables and settings, new service, create application, create cluster, cluster resources, workloads, network and role edit. Node pools were also checked with a pool expanded. Full passes covered 171 routes at 390px and again at 360px, plus every menu trigger opened on each page (142 menus) and landscape. A second pass covered 171 routes (every settings tab, creation flow step and service type: application, container, database, Helm, job), reviewed screenshot by screenshot. Also opened the user menu, breadcrumb switcher, service actions menu, AI Copilot panel and create environment modal; all stay inside the screen.

Desktop at 1024px and 1440px compared against screenshots from staging: no visible change.

  • Changes tested locally in the relevant Console's pages (Playwright, 390px, 360px and landscape)
  • yarn test: related specs locally (jest --findRelatedTests), full run in CI
  • yarn format
  • yarn lint on changed files: no errors
  • New specs: useHorizontalOverflowFade, isTouchScreen, scrollIntoViewHorizontally, tooltip tap and outside tap, sidebar collapse and arrow keys, InputText, InputSelect and Popover touch focus (shared mockPointerCoarse helper in util-tests)

Not tested on a real device. Live logs and instance metrics were not visible because the test service is stopped.

Known rough edge: the Helm values YAML editor scrolls horizontally on phones, on purpose.

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible
  • I only kept necessary comments, written in English
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code