Skip to content

test(client): cover mobile navigation visuals - #972

Open
edgars-avotins wants to merge 2 commits into
mainfrom
codex/fix-protofleet-mobile-navigation-visual
Open

test(client): cover mobile navigation visuals#972
edgars-avotins wants to merge 2 commits into
mainfrom
codex/fix-protofleet-mobile-navigation-visual

Conversation

@edgars-avotins

Copy link
Copy Markdown
Contributor

🤖 Reviewable diff: +5/-0 across 1 file (excludes generated, test, and story files).

Summary

This PR closes a responsive visual-coverage gap where ProtoFleet navigation changes were detected on desktop but could pass unnoticed on mobile because the drawer stayed closed in every screenshot. It adds a focused navigation capture at the end of the existing sign-up and empty-state visual scenario, after all target content screenshots are complete.

How it works

The existing scenario continues through sign-up and every empty-state page with the mobile drawer closed. At the end, the shared visual helper opens the drawer only when needed, locates the main navigation landmark, and compares that element with a dedicated project snapshot.

Diagrams

flowchart LR
  A["Sign up and empty-state scenario"] --> B["Capture existing page targets"]
  B --> C["Prepare responsive navigation"]
  C --> D["Capture main navigation element"]
  D --> E["Compare project snapshot"]
Loading

Areas of the code involved

Area / package / file What changed Why it matters for review
client/e2eTests/protoFleet/spec/onboardingVisual.spec.ts Adds the final navigation visual step Confirms content screenshots remain unobstructed
client/e2eTests/protoFleet/helpers/onboardingVisuals.ts Opens and captures the responsive navigation Keeps responsive UI details out of the spec flow
Visual snapshot baselines Adds desktop and mobile navigation expectations Generated visual expectations; review the images directly

Key technical decisions & trade-offs

  • Capture the navigation landmark after existing screenshots, over opening the drawer during page captures, so the drawer cannot hide the content under test.
  • Extend the existing visual scenario, over adding another state-coupled test, to keep the fake-backend onboarding flow unchanged.

Testing & validation

  • Temporary navigation probe reproduces the original gap: desktop visual validation should fail while mobile should pass.
  • With the navigation capture added and the probe retained, mobile visual validation should fail on the new snapshot.
  • After the probe is removed, desktop and mobile visual validation should pass.
  • Local navigation unit tests and touched-file ESLint pass.

@github-actions github-actions Bot added javascript Pull requests that update javascript code client labels Aug 26, 2026
@github-actions github-actions Bot added the review-policy: needs-review Managed by the Review Policy workflow. label Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated security-focused code review generated by Codex.
It should be used as a supplementary check alongside human review.
False positives are possible - use your judgment.

Scope summary

  • Reviewed pull request diff only (2380449e020fecb5a42a9627af7c37c6f84cbf7f...ecb6c3bd5564110e79c82504d3627df211d238cb, exact PR three-dot diff)
  • Model: gpt-5.6-sol

💡 Click "edited" above to see previous reviews for this PR.


Review Summary

Overall Risk: MEDIUM

Findings

[MEDIUM] Test-only navigation entry ships to every user

  • Category: Frontend
  • Location: client/src/protoFleet/config/navItems.ts:107
  • Description: The production navigation now includes an unrestricted /visual-probe entry, but no corresponding route exists. Clicking it falls through to the generic site-scope route, causing a site-slug lookup and redirect. The new navigation snapshots omit this entry, so the added visual test is also inconsistent with the current UI.
  • Impact: Every authenticated operator sees a nonfunctional menu item, clicking it causes an unnecessary RPC and confusing blank/redirect behavior, and the visual E2E suite should fail against the current bundle.
  • Recommendation: Remove the probe from primaryNavItems. If it is needed for testing, inject it through test-only fixtures rather than production configuration, then verify the checked-in snapshots against the intended navigation.

Notes

The authoritative diff contains no changes to authentication, databases, plugins, infrastructure, protobufs, or mining-pool configuration.


Generated by Codex Security Review |
Triggered by: @edgars-avotins |
Review workflow run

@edgars-avotins
edgars-avotins marked this pull request as ready for review August 26, 2026 12:37
@edgars-avotins
edgars-avotins requested a review from a team as a code owner August 26, 2026 12:37
Copilot AI lite review requested due to automatic review settings August 26, 2026 12:37

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 332806b138

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

scopable: true,
},
{
path: "/visual-probe",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the unmatched visual-probe navigation item

This ungated entry is rendered for every authenticated user, but a repo-wide search finds no /visual-probe route or component, and router.tsx has no matching route, so clicking it navigates users to the unmatched-route error page. The commit describes this as a temporary visual probe; remove it before landing rather than shipping a dead production navigation item.

AGENTS.md reference: AGENTS.md:L65-L68

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR, as currently diffed, modifies ProtoFleet’s primary navigation configuration by adding a new “Visual probe” entry. The stated goal in the PR description (adding mobile navigation visual coverage in the ProtoFleet Playwright visual suite) is not reflected in the included changes.

Changes:

  • Adds a new primaryNavItems entry for the /visual-probe path in ProtoFleet nav config.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +106 to +110
{
path: "/visual-probe",
label: "Visual probe",
icon: Activity,
},
Comment on lines +106 to +110
{
path: "/visual-probe",
label: "Visual probe",
icon: Activity,
},

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ecb6c3bd55

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

await minersPage.clickNavigationMenuIfMobile();
const navigationMenu = page.getByRole("navigation", { name: "Main" });
await expect(navigationMenu).toBeVisible();
await snapshots.captureLocator(navigationMenu, VISUAL_SNAPSHOTS.navigationMenu);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wait for the mobile settings animation before snapshotting

In the mobile project this runs immediately after captureEmptyStateScreens() leaves the app on /settings/mining-pools; opening the drawer mounts the auto-expanded settings submenu with a 300 ms opacity/position animation, but visibility of the outer <nav> does not mean that submenu has settled. The committed mobile baseline already shows the submenu labels at partial opacity, so subsequent runs can capture a different animation frame and fail without a UI regression. Wait for the submenu animation to finish, or navigate to a route that does not auto-expand it, before capturing the locator.

AGENTS.md reference: AGENTS.md:L74-L78

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client javascript Pull requests that update javascript code review-policy: needs-review Managed by the Review Policy workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants