Skip to content

feat: reusable core AppSidebar in toolkit and configurable top-left alpha badge - #4697

Merged
steve8708 merged 20 commits into
mainfrom
cursor/e46d0b20
Sep 10, 2026
Merged

feat: reusable core AppSidebar in toolkit and configurable top-left alpha badge#4697
steve8708 merged 20 commits into
mainfrom
cursor/e46d0b20

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Summary

  • Introduces reusable core AppSidebar components in @agent-native/toolkit and re-exported from @agent-native/core/client/ui, modeled directly on Shawn's Clips sidebar design.
  • Replaces global bottom-left beta/prod chips with a top-left brand badge defaulting to 'alpha'.
  • Gates the environment switcher popover interaction to @builder.io email sessions while showing static status badges to external visitors.
  • Makes the badge text configurable per application via the badgeText prop or agent-native.config.ts deployment configuration.
  • Standardizes sidebar structure, header, and footer utilities across template applications (Clips, Tasks, Slides, Design, Forms, Macros, Chat, Factory, Brain, Assets, Plan, CRM, Calendar, Content, Mail, Analytics, Dispatch).

Verification

  • Unit & render tests: packages/core/src/client/EnvironmentBadge.spec.ts, packages/core/src/client/EnvironmentBadge.render.spec.tsx, packages/toolkit/src/app-shell/sidebar.spec.tsx, and templates/slides/app/components/layout/Sidebar.test.tsx pass.
  • All 71 repo guards (pnpm guards) pass cleanly.
  • Visual screenshots captured for open and closed sidebar states across all applications.

…e-sidebar-and-alpha-badge.md, .claude/launch.json, … (78 files)
Resolve secrets UI/routes conflicts by taking main's managedHere and
asRequestUser changes.
builder-io-integration[bot]

This comment was marked as outdated.

@steve8708

Copy link
Copy Markdown
Contributor Author

Addressing the remaining Builder review-summary items that were not covered by the earlier inline-thread fixes:

  • Auth-page environment handoff — intentional. The React AuthPage duplicate badge was removed as part of consolidating the alpha badge into the shared sidebar / EnvironmentBadge placement. Signed-out auth HTML still gets the production handoff via injectBetaOptOutPersistence / __anInitEnvironmentBadge in beta-opt-out-html.ts, which auth routes continue to inject.
  • Shared collapse/group a11y English defaults — intentional for the toolkit primitive. AppSidebar exposes expandLabel / collapseLabel (and group labels via props) so localized apps can pass t(...). English defaults match other shared toolkit controls; nav item labels in migrated templates already go through t(...).

The five inline HIGH/MEDIUM findings were fixed and replied on the prior push (c12f468).

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration 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.

Builder reviewed your changes and found 5 potential issues 🔴

Review Details

Code Review Summary

PR #4697 centralizes the template sidebars around a new toolkit AppSidebar, adds the core wrapper and configurable environment badge, and migrates many applications away from bespoke sidebar implementations. The overall direction is sound: shared primitives reduce duplicated layout code and retain app-specific navigation through slots, while the badge configuration is cleanly exposed at the core boundary. I verified that the previously reported Mail content-offset issue is fixed by guarding the offset with !isMobile, and resolved that stale thread.

This is standard risk because the change affects shared UI infrastructure, package exports, authentication-adjacent environment navigation, and many application layouts.

Key Findings

  • 🔴 HIGH — The toolkit package is not included in the changeset even though Core now imports its new AppSidebar export; publishing Core without the matching toolkit release can fail module initialization.
  • 🟡 MEDIUM — Several migrated sidebars lose the existing command-search footer action.
  • 🟡 MEDIUM — Design editor routes no longer mark Designs active because the migration checks /d/ instead of /design/.
  • 🟡 MEDIUM — Signed-out/non-Builder users on beta can no longer follow the production link from the badge/auth flow.
  • 🟡 MEDIUM — The Content sidebar drops its expanded header wrapper and collapsed settings control sizing.

The shared component has useful extension points and focused typechecks reported by reviewers pass. Localization and accessibility regressions are also included below where applicable.

🧪 Browser testing: Will run after this review (PR touches UI code)

@@ -0,0 +1,6 @@
---
"@agent-native/core": patch

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.

🔴 Release the toolkit alongside the new AppSidebar export

This changeset bumps @agent-native/core, but not @agent-native/toolkit, despite adding the AppSidebar export in packages/toolkit/src/app-shell/index.ts. Core now imports that symbol from @agent-native/toolkit/app-shell; a consumer installing the patched Core with the currently published toolkit can therefore fail at module initialization. Add a patch changeset for @agent-native/toolkit so the export and Core release are published together.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: changeset now includes a patch bump for @agent-native/toolkit alongside core/dispatch so the new AppSidebar export publishes with Core.

brandName={APP_TITLE}
brandHref="/home"
secondaryItems={secondaryItems}
feedback={feedbackButton}

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.

🟡 Preserve the command-search action in migrated sidebars

The old chat sidebar passed a searchButton to its footer actions, but the replacement AppSidebar receives only feedback and the org switcher. The new footer has no search slot or built-in command-search control, so users lose the existing command-menu/search affordance (the same migration pattern affects other templates). Preserve the existing action through footerExtras or add an explicit search slot.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: command-search is restored via footerExtras on chat and the other migrated AppSidebar templates that previously exposed openCommandMenu (brain, assets, forms, tasks, slides, factory).

label: t("navigation.designs"),
icon: IconPencil,
active:
location.pathname === "/home" || location.pathname.startsWith("/d/"),

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.

🟡 Keep the editor route active in the Designs nav item

The active-route check was changed from the existing editor route prefix (/design/) to /d/. The Design app's router and surrounding route handling use /design/:id, so opening a design editor no longer marks Designs active in the sidebar. Restore the /design/ prefix, or support both if /d/ is intentional.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: Designs nav active state now matches /design/ (and still accepts /d/ if used).

className,
);

if (!isBuilder) {

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.

🟡 Keep the beta-to-production link available before authentication

The beta badge now returns a static status <div> whenever isBuilderIoEmployee(session?.email) is false, which includes signed-out visitors. That removes the production link from the badge/auth flow for visitors on a beta hostname, even though the environment target is still computed and the previous auth-page switcher was removed. Keep the production link available for unauthenticated visitors while restricting the internal-only popover controls.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: non-Builder visitors get a one-click lane switch link on the badge (beta→production / production→beta). The hide/popover controls stay Builder-only.

<div className="flex h-12 shrink-0 items-center justify-between border-b border-border px-3">
{brandButton(false)}
</div>
{brandButton(false)}

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.

🟡 Restore the expanded Content sidebar header container

The expanded render now inserts brandButton(false) directly, but brandButton returns an unstyled wrapper containing the brand button and inline environment badge. The previous parent supplied the fixed header height, padding, alignment, and bottom border, so the Content sidebar now loses its header boundary and the badge can stack below the brand. Keep an equivalent header flex container around these controls.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: restored the expanded Content header container (h-12 + border) and made the brand/badge row a flex container so the badge sits beside the brand.

@steve8708
steve8708 merged commit 97564cd into main Sep 10, 2026
18 of 19 checks passed
@steve8708
steve8708 deleted the cursor/e46d0b20 branch September 10, 2026 19:42
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.

1 participant