Repository navigation
feat(techdocs): migrate alpha plugin pages to BUI header system - #33437
Conversation
Changed Packages
|
🎨 Visual Testing with Chromatic
|
There was a problem hiding this comment.
Pull request overview
Migrates the TechDocs alpha plugin index + reader pages from legacy Page/Content wrappers to Backstage UI (BUI) layout components, while also adding small accessibility and styling fixes to @backstage/ui.
Changes:
- Replaces the alpha TechDocs index/reader page composition with new BUI-based components (
Header,Container,Card) and updates plugin branding (title/icon) plus adds aSupportButtonheader action. - Introduces a new TechDocs reader header/search/entity-card/content layout (including reactive hash scrolling via
useLocation()). - Updates
@backstage/uicomponents: makePluginHeaderdecorative icons aria-hidden; makeSearchAutocompletebackground-aware viabg: 'consumer'+data-on-bgstyling.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds lockfile entries for @backstage/ui and @remixicon/react usage in techdocs. |
| plugins/techdocs/src/alpha/index.tsx | Switches alpha routes to new BUI components, updates title/icon, adds PluginHeaderActionBlueprint. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.tsx | New BUI-based in-header search autocomplete for TechDocs reader. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.test.tsx | Adds basic tests for new reader search component. |
| plugins/techdocs/src/alpha/components/TechDocsReaderLayout.tsx | New reader layout composing header, entity card, subheader, and content inside a BUI Container. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.tsx | New BUI header for TechDocs reader with Helmet tab title, search, and source link. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.test.tsx | Tests for reader header rendering behavior and source-link visibility. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.tsx | Adds BUI card with entity kind/owner/lifecycle (plus optional inline search). |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.test.tsx | Tests entity card fields and conditional rendering. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.module.css | Styling for the new entity metadata card layout. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.tsx | New reader content wrapper with reactive hash scrolling and shadow DOM handling. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.test.tsx | Tests reader content rendering, loading/progress, and not-found behavior. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.tsx | New BUI container wrapper around existing TechDocs index filtering/table content. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.test.tsx | Tests index page content renders expected pickers/layout. |
| plugins/techdocs/package.json | Adds @backstage/ui and @remixicon/react dependencies for the new alpha UI. |
| plugins/techdocs-backend/examples/documented-component/catalog-info.yaml | Adds a remote TechDocs example component entry. |
| packages/ui/src/components/SearchAutocomplete/definition.ts | Marks SearchAutocomplete as background-aware (bg: 'consumer'). |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.tsx | Spreads dataAttributes to ensure bg/size attributes are applied to the correct element. |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.module.css | Adds background adjustments based on data-on-bg levels. |
| packages/ui/src/components/PluginHeader/PluginHeader.tsx | Adds aria-hidden=\"true\" to decorative plugin header icon container. |
| .changeset/happy-masks-allow.md | Changeset for @backstage/ui PluginHeader aria-hidden accessibility tweak. |
| .changeset/easy-pens-judge.md | Changeset for @backstage/ui SearchAutocomplete background awareness. |
| .changeset/fuzzy-mangos-design.md | Changeset for @backstage/plugin-techdocs alpha page migration to BUI. |
You can also share your feedback on Copilot code review. Take the survey.
1099573 to
6f3a40f
Compare
6f3a40f to
b565411
Compare
There was a problem hiding this comment.
Pull request overview
Migrates the TechDocs alpha plugin index + reader experiences from legacy Page/Content wrappers to Backstage UI (BUI) primitives, aligning the plugin with the newer header/container/card layout patterns and addressing the nested scroll container issue called out in the PR description.
Changes:
- Replaced TechDocs alpha index + reader page composition with new BUI-based components (
Header,Container,Card) and updated plugin branding/title/icon + added a plugin header support action. - Added new alpha reader building blocks (header, content, entity card, search, layout) with accompanying tests.
- Updated
@backstage/uito improve accessibility (PluginHeaderdecorative iconaria-hidden) and makeSearchAutocompletebackground-aware via the BUIbg: 'consumer'pattern.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds lock entries for new dependencies used by TechDocs alpha + BUI. |
| plugins/techdocs/package.json | Adds @backstage/ui and @remixicon/react dependencies for alpha UI migration. |
| plugins/techdocs/src/alpha/index.tsx | Switches alpha plugin to new index/reader components, updates icon/title, and adds a plugin header action. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.tsx | New BUI Container-based TechDocs index content composition. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.test.tsx | Tests for the new index content layout/pickers. |
| plugins/techdocs/src/alpha/components/TechDocsReaderLayout.tsx | New reader page layout composing header, entity card, subheader, and content. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.tsx | New BUI header with title/subtitle, search, source link, and Helmet tab title. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.test.tsx | Tests for header rendering, source link behavior, and document title. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.tsx | Reader content component with reactive hash scrolling using useLocation(). |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.test.tsx | Tests for content rendering/progress/404 behavior. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.tsx | New entity metadata card (kind/owner/lifecycle) with optional embedded search. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.module.css | Styling for the new entity card layout. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.test.tsx | Tests for entity card fields and conditional rendering. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.tsx | New BUI SearchAutocomplete-based TechDocs search UI for the reader header/card. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.test.tsx | Tests for the new reader search component (needs strengthening per review comments). |
| packages/ui/src/components/SearchAutocomplete/definition.ts | Marks SearchAutocomplete as background-aware (bg: 'consumer'). |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.tsx | Ensures background-related data attributes are applied to the correct DOM node. |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.module.css | Adds background-level overrides for neutral backgrounds. |
| packages/ui/src/components/PluginHeader/PluginHeader.tsx | Adds aria-hidden to decorative plugin header icon wrapper. |
| packages/ui/report.api.md | Updates API report for the new bg field on SearchAutocompleteDefinition. |
| .changeset/happy-masks-allow.md | Changeset for @backstage/ui PluginHeader accessibility fix. |
| .changeset/easy-pens-judge.md | Changeset for @backstage/ui SearchAutocomplete background-awareness. |
| .changeset/fuzzy-mangos-design.md | Changeset for @backstage/plugin-techdocs alpha migration updates. |
You can also share your feedback on Copilot code review. Take the survey.
b565411 to
7d7ae4b
Compare
| params: defineParams => | ||
| defineParams({ | ||
| loader: async () => ( | ||
| <SupportButton>Discover documentation in your ecosystem.</SupportButton> |
There was a problem hiding this comment.
I'm tempted to look into standardizing this as a PluginHeaderSupportBlueprint that accepts just a string or similar. All plugins would then get the support button top right if there's a configured app wide help, with the addition of this text if added. There could then be a noSupportButton option to disable this, and possibly a swap for the actual support trigger + content.
That way we'd get a more conform experience across plugins while still allowing customization at different levels.
There was a problem hiding this comment.
Hmm, yeah bit scared about encouraging people to do this already, I'd like to have the support button be moved across all pages at once if possible and prolly have it part of the PageLayout implementation. Is there space to keep it under the header for now?
Rugvip
left a comment
There was a problem hiding this comment.
Sweet! Could you add a .patches entry as well? I think we want to ship this immediately
7d7ae4b to
c2d06b1
Compare
| withSearch?: boolean; | ||
| }; | ||
|
|
||
| export const TechDocsReaderHeader = (props: TechDocsReaderHeaderProps) => { |
There was a problem hiding this comment.
Thinking there's a lot here that could potentially be extracted into a shared hook?
There was a problem hiding this comment.
Done, extracted lots of stuff shared between NFS and OFS to a separate set of hooks.
|
|
||
| const techDocsSupportAction = PluginHeaderActionBlueprint.make({ | ||
| params: defineParams => | ||
| defineParams({ |
There was a problem hiding this comment.
Oh shit, did not realize this one was still using defineParams, it shouldn't :p
Will look for a separate fix
There was a problem hiding this comment.
Pull request overview
This PR migrates the TechDocs alpha plugin’s index and reader experiences from legacy Page/Content wrappers to Backstage UI (BUI) layout primitives (Header, Container, Card), while also addressing UI library gaps discovered during the migration (PluginHeader a11y + SearchAutocomplete background awareness).
Changes:
- Replaced TechDocs alpha index and reader page compositions with new BUI-based components (header, entity card, reader content layout).
- Added a TechDocs plugin header action (SupportButton) and updated plugin branding (title/icon).
- Updated
@backstage/uicomponents to improve accessibility (decorative icon) and background-aware styling forSearchAutocomplete.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds new dependencies used by the TechDocs alpha migration (@backstage/ui, @remixicon/react). |
| plugins/techdocs/src/alpha/index.tsx | Switches alpha TechDocs routing to new BUI-based pages/layout; updates plugin title/icon; adds header action extension. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.tsx | New BUI Container-based index page content wrapper around existing catalog filter/table UI. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.test.tsx | Tests for rendering filter layout/pickers in the new index content component. |
| plugins/techdocs/src/alpha/components/TechDocsReaderLayout.tsx | New reader layout composing header, entity card, subheader, and content within a BUI container. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.tsx | New BUI Header for the reader, with Helmet tab title, optional search, source link, and addon actions. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.test.tsx | Tests header rendering, 404 hiding behavior, source link visibility, and tab title construction. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.tsx | New entity metadata card (kind/owner/lifecycle) with optional inline search fallback. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.module.css | Styling for the new entity metadata card layout. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.test.tsx | Tests entity card rendering rules (loading/missing metadata) and conditional search rendering. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.tsx | New reader content wrapper using useLocation() for reactive hash scrolling and Shadow DOM mounting. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.test.tsx | Tests content rendering, defaultPath plumbing, 404 behavior, and progress bar conditions. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.tsx | New BUI SearchAutocomplete-based reader search experience using plugin-search-react context. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.test.tsx | Tests for searchbox rendering and basic result display flow. |
| plugins/techdocs/package.json | Adds runtime deps required by the new alpha UI (@backstage/ui, @remixicon/react). |
| packages/ui/src/components/SearchAutocomplete/definition.ts | Marks SearchAutocomplete as background-aware (bg: 'consumer'). |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.tsx | Ensures dataAttributes (including bg-related attrs) are applied to the root element. |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.module.css | Adds background overrides keyed off data-on-bg levels. |
| packages/ui/src/components/PluginHeader/PluginHeader.tsx | Prevents screen readers from announcing decorative plugin icons (aria-hidden). |
| packages/ui/report.api.md | Updates API report to reflect new bg: 'consumer' on SearchAutocomplete definition. |
| .changeset/happy-masks-allow.md | Changeset for @backstage/ui PluginHeader a11y tweak. |
| .changeset/easy-pens-judge.md | Changeset for @backstage/ui SearchAutocomplete background-awareness. |
| .changeset/fuzzy-mangos-design.md | Changeset for @backstage/plugin-techdocs alpha page migration and branding/action updates. |
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: Johan Persson <[email protected]>
Signed-off-by: Johan Persson <[email protected]>
Signed-off-by: Johan Persson <[email protected]>
Signed-off-by: Johan Persson <[email protected]>
c2d06b1 to
601cf06
Compare
Signed-off-by: Johan Persson <[email protected]>
601cf06 to
00d0952
Compare
There was a problem hiding this comment.
Pull request overview
Migrates the TechDocs alpha index/reader pages to the BUI header system and refactors shared reader/search logic into reusable hooks, while also applying a couple of accessibility/styling fixes in @backstage/ui.
Changes:
- Introduce new BUI-based alpha TechDocs pages/layout components and update plugin title/icon + add a plugin header support action.
- Extract reader header/content + search behavior into shared hooks and update existing reader/search components to consume them.
- Make
@backstage/uiPluginHeaderdecorative iconaria-hiddenand makeSearchAutocompletebackground-aware.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds @backstage/ui and @remixicon/react dependencies for TechDocs alpha UI migration. |
| plugins/techdocs/src/search/components/TechDocsSearch.tsx | Switches TechDocs search bar logic to shared useTechDocsSearch hook. |
| plugins/techdocs/src/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.tsx | Refactors reader header logic to use shared useTechDocsReaderHeaderData. |
| plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx | Refactors reader content logic to use shared useTechDocsReaderContentData. |
| plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.test.tsx | Updates hash scrolling test to use router routeEntries. |
| plugins/techdocs/src/hooks/useTechDocsSearch.ts | Adds shared hook for TechDocs search results, filter sync, and deferred loading. |
| plugins/techdocs/src/hooks/useTechDocsSearch.test.tsx | Adds tests for the new TechDocs search hook behavior. |
| plugins/techdocs/src/hooks/useTechDocsReaderHeaderData.ts | Adds shared hook for reader header state, title sync, and source link visibility. |
| plugins/techdocs/src/hooks/useTechDocsReaderHeaderData.test.tsx | Adds tests for the new reader header data hook. |
| plugins/techdocs/src/hooks/useTechDocsReaderContentData.ts | Adds shared hook for reader content DOM setup, hash scrolling, and 404/loading state. |
| plugins/techdocs/src/hooks/useTechDocsReaderContentData.test.tsx | Adds tests for the new reader content data hook. |
| plugins/techdocs/src/alpha/index.tsx | Migrates alpha plugin entry to new BUI-based components; updates title/icon; adds support header action. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.tsx | Adds BUI-based reader search with autocomplete results rendering. |
| plugins/techdocs/src/alpha/components/TechDocsReaderSearch.test.tsx | Adds tests for the new BUI reader search component. |
| plugins/techdocs/src/alpha/components/TechDocsReaderLayout.tsx | Adds BUI-based reader layout composition (header, card, subheader, content). |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.tsx | Adds BUI-based reader header with Helmet title + source link + addons. |
| plugins/techdocs/src/alpha/components/TechDocsReaderHeader.test.tsx | Adds tests for the new BUI reader header behavior. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.tsx | Adds entity metadata card and optional inline search fallback for hidden header. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.test.tsx | Adds tests for the new entity metadata card and optional search rendering. |
| plugins/techdocs/src/alpha/components/TechDocsReaderEntityCard.module.css | Styles for the new entity metadata card layout. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.tsx | Adds BUI reader content wrapper using shared content hook and state indicator. |
| plugins/techdocs/src/alpha/components/TechDocsReaderContent.test.tsx | Adds tests for the new alpha reader content behavior and loading states. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.tsx | Adds BUI-based index page content using Container + catalog filter layout. |
| plugins/techdocs/src/alpha/components/TechDocsIndexPageContent.test.tsx | Adds tests for the new alpha index page content layout. |
| plugins/techdocs/report-alpha.api.md | Updates alpha API report for new plugin header action extension. |
| plugins/techdocs/package.json | Adds @backstage/ui and @remixicon/react to TechDocs plugin deps. |
| packages/ui/src/components/SearchAutocomplete/definition.ts | Marks SearchAutocomplete as background consumer (bg: 'consumer'). |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.tsx | Spreads dataAttributes onto root to apply bg/size attributes consistently. |
| packages/ui/src/components/SearchAutocomplete/SearchAutocomplete.module.css | Adds background-level aware styling via [data-on-bg=...]. |
| packages/ui/src/components/PluginHeader/PluginHeader.tsx | Makes decorative toolbar icon aria-hidden to avoid SR announcements. |
| packages/ui/report.api.md | Updates UI API report for new SearchAutocomplete definition bg metadata. |
| .patches/pr-33437.txt | Adds patch summary entry for the PR. |
| .changeset/happy-masks-allow.md | Changeset: PluginHeader decorative icon aria-hidden accessibility fix. |
| .changeset/fuzzy-mangos-design.md | Changeset: TechDocs alpha plugin page migration to BUI components. |
| .changeset/easy-pens-judge.md | Changeset: SearchAutocomplete background-aware styling. |
Comments suppressed due to low confidence (1)
plugins/techdocs/src/search/components/TechDocsSearch.tsx:1
- useTechDocsSearch
returnssetTerm, but it’s not being pulled out here. If this component is still controlling the autocomplete input viaterm(e.g.inputValue={term}) then it must also wiresetTerminto the input change handler; otherwise the search box can become effectively read-only or reference an out-of-scopesetTermfrom the previoususeSearchimplementation. Recommendation: destructuresetTermfrom the hook and pass it to theSearchAutocompleteinput change callback (or stop controllinginputValue` if you want it uncontrolled).
You can also share your feedback on Copilot code review. Take the survey.
|
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Signed-off-by: Github patch release workflow <[email protected]>
Signed-off-by: Github patch release workflow <[email protected]>
Signed-off-by: Github patch release workflow <[email protected]>
Signed-off-by: Github patch release workflow <[email protected]>
Hey, I just made a Pull Request!
Migrates the TechDocs alpha plugin's index and reader pages from legacy
Page/Content/ContentHeaderwrappers to BUI components (Header,Container,Card). The plugin title is changed to "Documentation" with aRiArticleLineicon, and aSupportButtonis added as aPluginHeaderActionBlueprint.New components under
plugins/techdocs/src/alpha/components/:ContainerHeaderwith doc title, search autocomplete, source link, and tab title via HelmetuseLocation()for reactive hash scrollingSearchAutocompletewith deferred loading stateShared hooks extracted under
plugins/techdocs/src/hooks/to eliminate duplication between alpha and legacy components:Also includes two
@backstage/uifixes:PluginHeadericon now hasaria-hidden="true"to avoid announcing decorative iconsSearchAutocompleteis now background-aware via the BUIbg: 'consumer'patternBug fix
This also fixes a bug where users could get stuck due to double scrollbars — with the new plugin header migration, the legacy
Pagewrapper created a nested scroll container that conflicted with the outer page scroll.Screenshots
✔️ Checklist
Signed-off-byline in the message. (more info)