Skip to content

Phone layout for Topology: filters collapse and overlay the graph - #2335

Merged
nadaverell merged 13 commits into
mainfrom
mobile/topology-phone
Oct 26, 2026
Merged

nadaverell merged 13 commits into
mainfrom
mobile/topology-phone

Conversation

@nadaverell

Copy link
Copy Markdown
Contributor

What

On a phone, Topology's filter panel took two thirds of the width from the graph.

  • The filters start collapsed to their icon rail on phones.
  • When expanded, they overlay the graph instead of squeezing it.
  • The graph itself pans and zooms as before.
  • Topology joins PHONE_READY_VIEWS.

Split out of #2324, which is superseded by this PR and #2328.

Desktop

Unchanged. The initial collapsed state and both new wrappers apply only under the phone rule; outside it the wrappers are display: contents. Compared against main on an EKS cluster (one namespace, since the whole cluster is too large to graph) at 1440 and 1024px, including collapsing and expanding the filters: differences are at the level of main against itself (1–2%, the graph layout varies between loads).

Screenshots

Radar Cloud on a GKE cluster with touch emulation. "Before" is radar main at 390px.

phone

The app shell keeps an ~800px content floor so desktop layouts don't squeeze
in narrow windows. Its content column clips horizontally, so on a phone every
view was laid out at 856px and its right half was unreachable. Below 640px
(the width Radar already treats as mobile) the floor no longer applies, and
the views that broke without it now reflow there:

- PageHeader: actions wrap under the title; the description wraps.
- Issue cards: in a narrow container the title row wraps and the per-row
  action joins the meta line, so the title keeps the full width.
- Resource detail: the header stacks (identity, then actions) and the
  tab-strip controls wrap under the tabs.
- Helm: Name (with the namespace under it), Status and Updated.
- Home cluster card: the three columns stack.
- The floating update prompt spans the width and drops the shell command.
Issue rows mounted their per-row actions twice (one copy hidden by the
container query). The header row now wraps instead: in a narrow container
the meta chips, actions and chevron move to a line of their own under the
title, so actions and chips each render once. Wide rows are unchanged.

On phones the Home resource links flow and wrap instead of a fixed two
columns, long Helm statuses wrap inside the badge, and the floating update
prompt links to the release for package-manager installs whose command it
hides.
Radar Cloud hides UpdateNotification when embedded, and this PR's scope
is what the hosted app renders on phones.
â€Ķone layout

A phone is now a narrow touch-first screen ((max-width: 639px) and
(pointer: coarse)): a desktop window narrowed past 640px keeps the 800px
floor and the desktop layout, and dev-tools device mode still gets the
phone layout. k8s-ui exports PHONE_MEDIA_QUERY, usePhoneLayout and a
phone: Tailwind variant so every surface switches on the same rule.

On a phone the shell floor is 360px. Views opt into the phone layout
through PHONE_READY_VIEWS; the rest keep their 800px desktop width in a
container that scrolls sideways, so nothing is squeezed or clipped.

The Issues, Helm and Home layouts move to their own PRs, so each view
gets its own design pass; the shared page header and detail shell stay
here, on the phone: variant.
On a phone the filter panel starts collapsed to its icon rail, and when
expanded it overlays the graph instead of taking two thirds of the width.
Topology joins PHONE_READY_VIEWS; the graph itself pans and zooms.

Desktop is unchanged: both new wrappers are display: contents outside the
phone layout.
@nadaverell
nadaverell requested a review from hisco as a code owner October 26, 2026 11:55
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Overlay Topology filters on phones without shrinking the graph

âœĻ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

â€Ē Start phone Topology with filters collapsed to preserve graph space.
â€Ē Overlay expanded filters on the graph while keeping desktop layout unchanged.
â€Ē Mark Topology as phone-ready so it uses the narrow content layout.
Diagram

graph TD
  App["App layout"] --> Width{"Phone width?"} -->|yes| Frame["Topology frame"] --> Sidebar["Filter sidebar"] -->|expanded overlay| Graph["Graph pane"]
  Frame --> Graph
  Width -->|no| Desktop["Desktop layout"] --> Graph
  Desktop --> Sidebar
Loading
High-Level Assessment

The conditional wrappers are a focused way to preserve desktop layout while anchoring the phone overlay to Topology; a broader sidebar rewrite is unnecessary. Before merging, restore the removed k8s-ui import, import PHONE_MEDIA_QUERY, and remove the duplicate PHONE_READY_VIEWS declaration: as shown, App.tsx cannot compile.

Files changed (1) +15 / -6

Enhancement (1) +15 / -6
App.tsxGive phone Topology a collapsed filter rail and graph overlay +15/-6

Give phone Topology a collapsed filter rail and graph overlay

â€Ē Adds Topology to the phone-ready views and initializes its filters as collapsed when the phone media query matches. On phones, a positioned wrapper lets expanded filters overlay the graph; on desktop, display-contents wrappers retain the previous layout. The diff also inadvertently replaces a component import with a duplicate constant declaration and references PHONE_MEDIA_QUERY without importing it.

web/src/App.tsx

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) ðŸŽĻ UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. The app cannot build with the new import ✓ Resolved
Description
The replacement at line 12 removes the import for the topology components and usePhoneLayout,
inserts a second PHONE_READY_VIEWS declaration, and leaves the new PHONE_MEDIA_QUERY reference
without an import. Type-checking App.tsx encounters duplicate declarations and unresolved names,
so the web build fails before the phone layout can run.
Code

web/src/App.tsx[12]

+const PHONE_READY_VIEWS: ReadonlySet<ExtendedMainView> = new Set<ExtendedMainView>(['issues', 'topology'])
Evidence
The original import is replaced by a declaration at line 12, while the topology components and hook
are still used. The same constant is declared again at line 138, and the new initializer uses
PHONE_MEDIA_QUERY, whose definition is exported from a different module but not imported into
App.tsx. The web build runs TypeScript checking.

web/src/App.tsx[9-14]
web/src/App.tsx[135-138]
web/src/App.tsx[606-610]
web/src/App.tsx[673-673]
web/src/App.tsx[2198-2202]
packages/k8s-ui/src/hooks/usePhoneLayout.ts[1-12]
web/package.json[16-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new declaration at the import location replaces the topology import, duplicates `PHONE_READY_VIEWS`, and leaves `PHONE_MEDIA_QUERY` unresolved, preventing the web app from building.
## Fix Focus Areas
- web/src/App.tsx[12-12]
- web/src/App.tsx[138-138]
- web/src/App.tsx[608-610]
## Recommended Fix
Restore the removed topology-component and `usePhoneLayout` imports, import `PHONE_MEDIA_QUERY` from its exported module, and retain only the `PHONE_READY_VIEWS` declaration at line 138.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
ðŸ’Ą Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread web/src/App.tsx Outdated
Comment thread web/src/App.tsx Fixed
Comment thread web/src/App.tsx Fixed
With Topology opted in to the phone layout there is no sideways scroll,
and the overlay row (search, freshness, Policies, grouping, Resources /
Network Flow / Fleet) was wider than the canvas, clipping the mode
buttons. On phones the controls wrap below the search and within
themselves.
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@nadaverell
nadaverell merged commit 926f96d into main Oct 26, 2026
11 checks passed
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.

2 participants