Commit Graph

108 Commits

Author SHA1 Message Date
Patrik Oldsberg 305f4edf00 Fix toast surface tokens for current BUI theme
Update the toast surface and interaction styles to use the current overlay token set so notifications render with the intended background and focus treatment after the BUI token changes.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:45:23 +01:00
Patrik Oldsberg c7201754af Merge master and update toastApiRef to new ApiRef pattern
Resolve merge conflicts from master introducing the new ApiRef_2 type
pattern with `.with()` builder. Update toastApiRef to use the same
`createApiRef<T>().with({ id, pluginId })` pattern as all other API
refs, and regenerate API reports.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:45:22 +01:00
Patrik Oldsberg 72dd26a3a6 frontend-app-api: route sign-in errors through app boundary
Rethrow sign-in bootstrap failures from inside the prepared sign-in tree so the app root extension boundary handles them instead of createApp keeping its own error state. This keeps bootstrap error handling aligned with the rest of the extension tree.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:01:48 +01:00
Patrik Oldsberg 00381fa7b2 frontend-app-api: add session boundary app initialization
Instantiate the app shell up to app/root.children during sign-in, then rebuild the full tree after sign-in without cloning the app tree.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:00:19 +01:00
Patrik Oldsberg fc08a9b4dd plugin-app: keep identity proxy in prepared finalize flow
This fixes the prepare/finalize sign-in flow so finalized apps continue to use AppIdentityProxy, including protected-mode cookie auth behavior. It also avoids setting guest identity in protected mode when no sign-in page is configured, which lets pre-captured identities remain intact.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 12:59:58 +01:00
Patrik Oldsberg ed3483e560 Merge remote-tracking branch 'origin/master' into bui-toast
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

# Conflicts:
#	packages/frontend-defaults/src/createPublicSignInApp.test.tsx
#	yarn.lock
2026-03-17 12:05:59 +01:00
Patrik Oldsberg 3f36ce1257 Clarify icon sizing rules for NFS icons
Document the IconElement sizing contract, ensure deprecated icon component registrations inherit size correctly, and add changesets for the affected icon migration packages.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 21:39:40 +01:00
Patrik Oldsberg ed8d9ce67c further NFS icon migration and alignment
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-16 21:39:40 +01:00
Johan Persson 42f8c9b2b8 feat(ui): centralize routing in BUIProvider (#33267)
* feat(ui): centralize routing in BUIProvider

BUIProvider now auto-detects React Router context and provides
client-side navigation for all BUI components. Retired
InternalLinkProvider and added BUIRouterProvider as a public
export for integration use.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(plugin-app): move BUIProvider inside app router

Moved BUIProvider from wrapping AppRouter to being a child inside
it, so it detects the React Router context and provides client-side
routing for all BUI components.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(core-app-api): add BUIRouterProvider to legacy app router

Added BUIRouterProvider inside the legacy AppRouter to provide
React Aria routing for all BUI components.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): update BUIProvider documentation for routing

Updated installation docs to cover BUIProvider's routing role
and the requirement to render it inside a React Router context.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): move BUIProvider from analytics to provider directory

BUIProvider now handles both analytics and routing, so it no longer
belongs in the analytics directory.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(ui): add BUIProvider to storybook stories with MemoryRouter

Added BUIProvider inside MemoryRouter in all stories that use
routing, so client-side navigation works in Storybook.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(plugin-app): move BUIProvider inside RouterComponent

Moved BUIProvider to wrap all content inside RouterComponent
so that extraElements (like dialogs) also get BUI context.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor: replace BUIRouterProvider with BUIProvider in legacy app

Use BUIProvider directly inside the legacy AppRouter instead of a
separate BUIRouterProvider export. Removes BUIRouterProvider from
the public API of @backstage/ui.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): inline routing logic into BUIProvider

Removed the routing/ directory and inlined the RouterProvider
setup directly into BUIProvider since it's the only consumer.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-16 18:56:24 +01:00
Patrik Oldsberg 9508514116 frontend-plugin-api: promote PluginWrapper API to stable with useWrapperValue hook
Promote PluginWrapperApi, pluginWrapperApiRef, PluginWrapperBlueprint, and
the new PluginWrapperDefinition type from @alpha to @public. Add getRootWrapper()
method to PluginWrapperApi and integrate the useWrapperValue hook pattern from
the rugvip/plugin-wrapper branch, allowing plugin wrappers to share stateful
values via a hook that runs once in the root wrapper and is distributed to all
wrapper instances via useSyncExternalStore.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 11:19:57 +01:00
Johan Persson 12d8afe82d feat(ui): add analytics event tracking to BUI navigation components (#33150)
* feat(ui): add analytics types

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add useAnalytics hook with dev-mode swap guard

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add AnalyticsProvider, getNodeText, and analytics barrel exports

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): integrate analytics into defineComponent and useDefinition

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to Link component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to ButtonLink component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to Tab component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to MenuItem component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to Tag component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): add analytics tracking to Table Row component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): widen getNodeText to accept render functions

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore(ui): update API reports

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: add changeset for BUI analytics

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(ui): chain MenuItem onAction with user-provided handler instead of overwriting

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore(ui): address review feedback — changeset wording and types docs

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(core-app-api): wire AnalyticsProvider from @backstage/ui into app shell

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(plugin-app): add AnalyticsProvider wrapper extension for BUI components

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: update API reports

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: update API reports for core-components and scaffolder

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): add analytics documentation and noTrack prop to component docs

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: update yarn.lock

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(plugin-app): move AnalyticsProvider into AppRoot directly

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: format installation docs

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(ui): call user onPress before analytics in Tag component

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): replace AnalyticsProvider with generic BUIProvider

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: replace remaining AnalyticsProvider references with BUIProvider

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(plugin-app): import useAnalytics from frontend-plugin-api

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): improve noTrack prop description

Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-06 14:45:57 +01:00
Patrik Oldsberg 909c742c18 Stabilize translation API in the new frontend system
Remove @alpha tags from translation-related types and switch all
translation API imports in new frontend system packages to use stable
paths from @backstage/frontend-plugin-api instead of
@backstage/core-plugin-api/alpha.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 21:23:05 +01:00
Patrik Oldsberg 26135af5b3 app: stop exporting toast display
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 15:14:29 +01:00
Patrik Oldsberg da5a35a38c frontend-plugin-api,app: move toast forwading to be internal
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 15:01:16 +01:00
Charles de Dreuille 2f4e800d66 Fix tests
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:11 +01:00
Charles de Dreuille d007f23162 Address another set of feedbacks
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:10 +01:00
Charles de Dreuille 033ec31a33 Cleanup Toast after feedbacks
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:10 +01:00
Charles de Dreuille aa1d73a798 Rename ToastMessage into ToastApiMessage
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:10 +01:00
Charles de Dreuille e0b7eb0b64 Improve toast layout
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:10 +01:00
Charles de Dreuille eea95b8ae2 Add tests and deprecation warnings
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:39:09 +01:00
Charles de Dreuille a47f27c0a9 Improve package versioning and cleanup
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:38:50 +01:00
Charles de Dreuille 54dd710eb1 Fix reports
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:26:05 +01:00
Charles de Dreuille 91d9dccb5c Add new ToastApi
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-02-17 14:26:05 +01:00
Patrik Oldsberg cfb4177cd8 review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 13:42:26 +01:00
Patrik Oldsberg 40dfe4a00f frontend-plugin-api: drop match strategy from PageLayout tabs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 13:14:45 +01:00
Patrik Oldsberg b7ae1243e0 frontend-plugin-api: make header actions a element[]
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 12:35:20 +01:00
Patrik Oldsberg 31222cc921 app: use PluginHeader
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:58:16 +01:00
Patrik Oldsberg 92d77a98ff rename header action to plugin header action
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:37 +01:00
Patrik Oldsberg 85261a3b3c frontend-plugin-api: use react element for header action
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:35 +01:00
Patrik Oldsberg 5920062fcc app-react: API cleanup and component utility for nav items
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:34 +01:00
Patrik Oldsberg 1fcffa72e3 app-react: new API for consuming nav items that detects page extensions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:30 +01:00
Patrik Oldsberg 5fa6797b95 app: remove a bunch of wrapping page elements
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:29 +01:00
Patrik Oldsberg 7b82dca42b app: hide plugin header if there are no subpages for now
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:29 +01:00
Patrik Oldsberg 4d2b2642c0 frontend-plugin-api: added noHeader param for page blueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:28 +01:00
Patrik Oldsberg 133dff7320 app: fix new PageLayout layout
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:24 +01:00
Patrik Oldsberg d6de6069aa frontend-plugin-api: switch to just PageHeaderAction
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:24 +01:00
Patrik Oldsberg 4738047ab7 frontend-plugin-api: intial page and plugin header actions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:24 +01:00
Patrik Oldsberg abd0a5ad52 frontend-plugin-api: migration to IconElement + API reports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:23 +01:00
Patrik Oldsberg 3fd3d82360 app: remove page layout gap
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:23 +01:00
Patrik Oldsberg e1f22f2d15 plugin icons and titles
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:22 +01:00
Patrik Oldsberg 4b996d05d3 frontend-plugin-api: initial support for subpages
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-17 11:55:22 +01:00
Patrik Oldsberg d56d9eae3c Explicitly disable v7 future flags to suppress warnings
Rather than removing the future prop, set v7_relativeSplatPath and
v7_startTransition to false so react-router stops logging deprecation
warnings.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-13 15:09:23 +01:00
Patrik Oldsberg 47d064a51b Revert react-router v7 future flags from #31818
Roll back the v7_relativeSplatPath and v7_startTransition future flags
and the Outlet-based route structure, keeping the version bump to
react-router-dom@^6.30.2.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-12 10:03:13 +01:00
Paul Schultz a7e0d506a2 feat: enable react router feature flags for v7
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2026-02-03 09:37:11 -06:00
Patrik Oldsberg c38b74df5f frontend-plugin-api: complete deprecation of app blueprints
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-23 11:41:16 +01:00
Patrik Oldsberg 7edb810248 frontend-plugin-api: add new internal option for extension inputs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-23 11:41:15 +01:00
Patrik Oldsberg a1be5e1770 review fixes for plugin wrapper blueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-20 00:11:46 +01:00
Patrik Oldsberg f9d5756354 app: add missing plugin wrapper API
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-19 14:14:23 +01:00
Patrik Oldsberg 85c8156984 frontend-plugin-api: simplify deprecation of AppRootWrapperBlueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-19 14:14:21 +01:00
Patrik Oldsberg d194acb0e3 frontend-plugin-api: move new PluginWrapper to alpha
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:08:58 +01:00