Skip to content

feat(frontend): /m developer mode app menu inside an app - #8143

Merged
mmabrouk merged 5 commits into
release/v0.128.9from
feat/m-parity-app-menu
Nov 6, 2026
Merged

mmabrouk merged 5 commits into
release/v0.128.9from
feat/m-parity-app-menu

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Context

Inside an app, /w swaps the rail to an app menu: Back, an app switcher, then Overview, Playground, Registry, Evaluations and Observability. In /m developer mode the rail never changed. The app overview and playground lit up "Home", there was no way from the playground to the same app's overview or Registry, and the only app pickers were the per page ones on Variants and Endpoints.

Changes

With beta developer mode on, an app page shows the app menu:

  • Back returns to the last page the main rail showed (Prompts if there is none).
  • App switcher: the shared WorkflowPickerView with the project's prompt apps (name, "Prompt" tag, a check on the current app). Switching keeps the page: Overview stays Overview, Registry stays Registry (the revision is dropped, the tab is kept).
  • Overview, Playground, Registry, Evaluations, Observability with the /w labels and icons. Home is not in this menu, so it no longer lights up inside an app.
  • Collapsed rail: toggle, Back and the app icon stack like /w, then one icon per row.

Which pages get the menu: /apps/<id>/overview, /apps/<id>/playground, and Registry or Endpoints with ?app=<id>. useRailScope picks the scope for the docked rail and the drawer, the same way Settings passes its own scope.

The switcher is loaded with next/dynamic and reads only the current app until it is first opened; the app list loads on open. The scope itself is a few links.

Shared package fix (this changes /w in production): in WorkflowPickerView, a mouse or keyboard pick did nothing. The anchor's click handler called preventDefault, and Radix skips the item's onSelect when the event is already prevented. The view now makes the pick itself. This changes /w in production too: today, picking another app in the /w app switcher does nothing (checked on the parity stack, by mouse and by keyboard). With this PR it opens that app, on the same page. The /w type check passes.

Without beta developer mode nothing changes: the scope choice is gated on betaDeveloperModeActiveAtom, and every app page keeps the main rail.

What PR 1.5 must change

For now Registry, Evaluations and Observability link to the project pages with ?app=<id>. PR 1.5 should:

  • add /apps/<id>/variants (and ?tab=deployments), /apps/<id>/endpoints, /apps/<id>/evaluations and /apps/<id>/traces, and point the three menu rows at them (appNavItems in appNavScope.tsx);
  • replace APP_QUERY_ROUTE in appScopeAppId with those routes, and the ?app= branch of appSwitchHref;
  • drop the Registry matchLinks override and the Registry row at the end of the main rail (developerRailItems);
  • delete the ?app= Variants and Endpoints pages and their pick-app states.

Until then, Evaluations and Observability open the project pages and the rail switches back to the main rail there.

Not matched yet

  • The switcher lists prompt apps only. /w also lists LLM judge evaluators, but /m has no evaluator pages yet (PR 5.4).
  • The app icon uses the /m info colours (navy on light blue); /w uses the brighter antd blue.

Stacked on #8140 (base feat/m-parity-rail). That branch is based on main with #8133 and #8134 merged in.

Tests

  • appNavScope.test.tsx: which pages get the menu, its rows and links, Registry stays selected with a revision in the URL, switching keeps the page, and the gate (beta on: app menu; beta off: main rail on every app page).
  • workflowPickerView.render.test.tsx: a plain click picks the app and closes the menu (fails before the fix); a ctrl or cmd click does not pick in the current tab.
  • /m and /w type checks and lint on changed files pass.
  • Live check on the parity stack at 1440 px: app menu and collapsed rail side by side with /w; switching apps by mouse and keyboard; Back. Without developer mode the rail on the app overview and on Variants with an app is pixel identical to before.

What to QA

  • Beta developer mode on: open an app from Prompts. The rail shows Back, the app card, Overview, Playground, Registry, Evaluations, Observability, and Playground is selected.
  • Open the app card and pick another app: you land on the same page of the other app.
  • Click Registry: the Variants page for this app opens and the app menu stays.
  • Collapse the rail: toggle, Back, app icon, then one icon per row.
  • Click Back: you return to Prompts.
  • Regression: with beta developer mode off, the app overview, playground and Variants pages keep the main rail as before.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Summary

Summary by CodeRabbit

  • New Features
    • Added app-specific navigation in beta developer mode, with an app switcher that keeps the current page and supported tab selections when switching apps.
    • Added a back link to the last main navigation page and a project switcher within app navigation.
  • Bug Fixes
    • App-switcher selections now close the menu and navigate reliably; modified clicks retain standard link behavior.

The mobile navigation rail now supports an app-specific menu in beta developer mode. The menu includes app navigation and app switching. Rail selection and last main-rail path tracking are handled by shared hooks.

Changes: Mobile app navigation

Layer / File(s) Summary
App switching and picker selection
web/mobile/src/features/nav/AppSwitcher.tsx, web/packages/agenta-navigation-ui/src/WorkflowPickerView.tsx, web/mobile/tests/unit/appNavScope.test.tsx, web/mobile/tests/unit/workflowPickerView.render.test.tsx
The app switcher lists prompt apps and builds URLs that retain supported page and tab parameters. Selecting a different app navigates to its destination. Plain picker-link clicks call the selection callback with the entry key. Tests cover URL behavior and picker selection.
App-specific navigation scope
web/mobile/src/features/nav/appNavScope.tsx, web/mobile/tests/unit/appNavScope.test.tsx
The app scope derives an app ID from supported routes and builds app navigation rows. It also provides a header with Back navigation and the app switcher, a footer, and a project switcher. Tests cover route matching and menu contents.
Rail selection and last-path tracking
web/mobile/src/features/nav/railScope.ts, web/mobile/src/features/nav/AppShell.tsx, web/mobile/src/features/nav/NavDrawer.tsx, web/mobile/src/features/nav/NavRail.tsx, web/mobile/tests/unit/appNavScope.test.tsx
The rail resolver selects an explicit override, the app scope, or the main scope. AppShell records the last main-rail path, and NavDrawer and NavRail use the shared resolver. Tests cover rail selection with beta developer mode enabled and disabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant WorkflowPickerView
  participant AppSwitcher
  participant Router
  User->>WorkflowPickerView: selects an app entry
  WorkflowPickerView->>AppSwitcher: calls onSelect with the entry key
  AppSwitcher->>Router: navigates when the selected app differs
Loading

Possibly related PRs

  • Agenta-AI/agenta#8003: Adds the /variants Registry route and app and tab query parameters used by app navigation and switching.
  • Agenta-AI/agenta#8120: Adds beta developer mode and developer views used to select the app-scoped rail and its enabled links.
Merge Risk: Low · previous review 56d14

Ctrl-clicking an app in the switcher may also navigate the current tab. The impact is small and recoverable, so the change is mergeable with a small follow-up fix.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title identifies the developer-mode app menu added to /m.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description matches the app-scoped rail, app switcher, shared picker fix, and tests in the changeset.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 9 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-8143-agenta-website-preview.mahmoud-637.workers.dev

Built from e7b4f93537186ad5ff8c74ddf6645cec25e8a685. This comment updates in place on every push.

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: @coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

@mmabrouk I’ll start a review of this PR.

Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mmabrouk
mmabrouk force-pushed the feat/m-parity-app-menu branch from 56d14e1 to 6c8d046 Compare November 6, 2026 08:58

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Nitpick comments: 2

web/mobile/src/features/nav/AppSwitcher.tsx: 2

32-60: Trivial · Maintainability & Code Quality · Quick win

Move AppIdentity to its own file.

AppSwitcher.tsx defines two components: AppIdentity and AppSwitcher. The mobile conventions allow one component per file, named after the file. Extract AppIdentity to AppIdentity.tsx and import it.

As per coding guidelines: "One component per file, exported with a name matching the file name."

Source: Coding guidelines


44-44: Trivial · Maintainability & Code Quality · Quick win

Use mobile semantic tokens in AppIdentity.

Replace the three legacy color classes with semantic tokens. Preserve the app icon’s info colors in both themes. If no suitable semantic role exists, add one through the token generator.

Source: Coding guidelines

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e97c453 and 56d14e1.

Files selected for processing: 9

  • web/mobile/src/features/nav/AppShell.tsx
  • web/mobile/src/features/nav/AppSwitcher.tsx
  • web/mobile/src/features/nav/NavDrawer.tsx
  • web/mobile/src/features/nav/NavRail.tsx
  • web/mobile/src/features/nav/appNavScope.tsx
  • web/mobile/src/features/nav/railScope.ts
  • web/mobile/tests/unit/appNavScope.test.tsx
  • web/mobile/tests/unit/workflowPickerView.render.test.tsx
  • web/packages/agenta-navigation-ui/src/WorkflowPickerView.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: On the two review body items: AppIdentity is now in its own file (AppIdentity.tsx), and its type label uses text-muted-foreground. The icon square keeps bg-colorInfoBg and text-colorInfo: those are generated theme tokens (no hex), and the semantic set has no info role. Adding one through the token generator for a single icon is more change than it is worth here; a comment in the file says so.

@mmabrouk
mmabrouk force-pushed the feat/m-parity-app-menu branch from a61cc8c to bcd24aa Compare November 6, 2026 09:14
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit e7b4f93537186ad5ff8c74ddf6645cec25e8a685
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/42211473471

Preview use finished or expired. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Batch review item fixed in 98bab16: the app switcher link and the app menu links now encode the app id (encodeURIComponent), with a test for an id with /, ? and #. Merged up into #8151, #8152, #8153 (no rebase).

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Batch items 2 and 3 fixed in e7b4f93 (merged up into #8151 to #8153 and the WS4 stack, no rebase):

  • Prettier line break in WorkflowPickerView.tsx. pnpm run lint passes for all packages and Prettier passes on every changed file.
  • The app menu code (appNavScope.tsx: menu rows, icons, header, switcher loader) now loads with a dynamic import() only when beta developer mode is on and the page is inside an app. Every page with a rail keeps only railScope.ts and the small route rule in appRoute.ts. speed:check after next build: app shell 884.8 KB to 884.1 KB; /agents 1049.3 to 1045.8 KB, /prompts 1042.3 to 1037.3 KB, /settings 1039.8 to 1035.6 KB. The shell is 0.5 KB above the 883.6 KB baseline: that is the scope choice and the Back-path tracker that every rail runs.

@mmabrouk
mmabrouk changed the base branch from feat/m-parity-rail to release/v0.128.9 November 6, 2026 14:13
@mmabrouk
mmabrouk merged commit d484497 into release/v0.128.9 Nov 6, 2026
83 of 88 checks passed
@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant