182 Commits

Author SHA1 Message Date
Kam 6f5406c678 fix(docs-infra): correct example viewer tab state and line numbering
Five more defects in the example viewer, following #70508.

The DOM was queried before Angular rendered it. `setCodeLinesVisibility()`
walks the rendered lines but ran synchronously on tab change, so it measured
the outgoing tab and the incoming file showed in full. The selected tab was
also lost when the code block was hidden and reshown, because the recreated
tab group had no `[selectedIndex]` while `snippetCode` survived, leaving the
strip and the code disagreeing.

`expandable` was computed once at startup by counting hidden DOM nodes, so a
collapsed tab offered no way to expand it, and recomputing that count on tab
change would drop the control whenever the block was expanded, since nothing
is hidden then. Both paths now share one rule: a file is expandable when it
has a `visibleLinesRange` and either the block is expanded or the range
actually hides lines, so a range that covers its whole file still gets no
inert control.

Array indices were also mixed with 1-based line numbers: the gap check tested
`index - 1` for the preceding line, drawing a `...` separator inside
contiguous ranges, and the gutter tested `index` while the code tested
`index + 1`, shifting every line number by one.

Five new specs cover these, using the comma-separated range format the
pipeline emits; each fails with its fix reverted. The tab label also moves
from 0.8125rem to 0.875rem to match the code beside it.

(cherry picked from commit 26afa313f3)
2026-09-04 07:26:29 -07:00
Kam e44904ddda fix(docs-infra): keep the collapsed code state when a code block is reshown
The code block lives inside `@if (showCode())`, so hiding it destroys the DOM and
showing it builds a fresh copy with no hidden lines. Nothing reapplied
`setCodeLinesVisibility()`, so a collapsed block came back showing the whole file.

Reapply it once the block is rendered again. It already branches on `expanded()`,
so a block that was expanded stays expanded.

(cherry picked from commit 90b9e081f5)
2026-09-02 14:32:22 -07:00
Kam 65e2aed04f fix(docs-infra): contain scroll within adev dropdown menus
Scrolling to the top or bottom of a dropdown let the scroll event chain into
the page behind it, causing the whole app to scroll. #70137 fixed this for the
version picker, but the same containment was missing on every other menu.

The API reference filter, the tutorial step list and the update guide's version
dropdowns already had a scroll container, so they only needed
overscroll-behavior.

The social and theme mini-menus had neither a height cap nor overflow, so
overscroll-behavior alone would have been inert on them. They now share the
version picker's max-height/overflow-y/overscroll-behavior, hoisted onto
.adev-mini-menu, which also keeps their items reachable when the viewport is
too short to fit the whole menu.

(cherry picked from commit dd29713828)
2026-08-11 17:00:57 +00:00
Kam 6a3487f7b7 feat(docs-infra): greet visitors with Angie in the cookie popup
The cookie consent popup showed only text and two buttons. Add the
Angie greeting pose to it so the first thing a new visitor sees carries
the same mascot treatment already used across the docs (the 404 page,
empty search results, the preview error state).

The message and mascot sit in a flex header row; the two action buttons
now share the row equally so they fill the card instead of leaving a
trailing gap. Layout only, the consent behaviour is unchanged.
2026-07-15 11:54:50 -07:00
Kam e6378eb330 fix(docs-infra): avoid search dialog empty-state flicker while re-querying
The search dialog picked its empty state ("Start typing" vs "No results
found") with `!resultsResource.hasValue()`, which during a re-query looks
identical to a freshly opened dialog since the resource resets its value and
reports `loading`. This flipped the message and mascot back to "Start typing"
mid-search, causing a question -> magnifying-glass -> question flicker on every
keystroke. Add an `emptyState` signal that holds the previous state while a
search is settling, so the dialog only changes once results resolve.
2026-07-10 10:58:53 -07:00
Kam 95fbd0bd48 feat(docs-infra): add Angie mascot to adev empty and error states
Several adev states show only plain text today. This brings the Angie
mascot into them for warmer, more on-brand empty states, with no change
to copy or behavior:

- Search dialog: a magnifying-glass Angie on "Start typing to see
  results", a questioning Angie on "No results found".
- API reference: a questioning Angie on "No API items found." and on the
  package filter's "No results found".
- Deprecated API pages: the back-turned orthos pose in the shared
  deprecation warning.

The mascots are decorative (aria-hidden) and sized per placement; the
poses are added as SVG assets under assets/images/angie/.

Also moves the Shiki highlighter init in the jsdoc-transforms spec into a
beforeAll, fixing a flake where the spec failed under randomized test
order.
2026-07-08 12:18:42 -07:00
Kam 5ec0b1668b fix(docs-infra): disable nav-list tooltip on mobile
On mobile, focusing a long nav item shows a matTooltip that escapes the
drawer, ignores inner scroll, and blocks scrolling while open. Suppress
it on mobile using the existing isMobile helper.
2026-07-07 09:54:47 -07:00
Kam 4b0c066e22 fix(docs-infra): keep mobile nav open when closing the search dialog
Backdrop clicks on the search dialog were also closing the open mobile nav drawers. Adds an id to `<dialog>` and references it from both navs' `docsClickOutsideIgnore` arrays.
2026-07-07 09:54:14 -07:00
Kam e4ffb24ecb fix(docs-infra): keep copy link icon out of the search index
The copy link button rendered its icon as a Material Symbols ligature text node, and since the button is appended inside each heading's `.docs-anchor`, that text leaked into the heading and the Algolia crawler indexed values like `Descriptionlink`. The glyph is now rendered via a `::before` pseudo-element using the icon codepoint, so no `link`/`check` text exists in the DOM and headings index correctly again.
2026-07-06 13:39:11 -07:00
yamanerkam 00226e7d80 fix(docs-infra): align and highlight external-link icon in nav sidebar
The open_in_new icon on external navigation items stayed grey on hover
and sat inset from the chevron column, so it never matched the chevron
items visually.

- Add a hover rule so the icon brightens to --primary-contrast along
  with the label, matching the chevron/text behaviour.
- Override the 1rem max-width reserve inherited from
  .docs-faceted-list-item-text by chaining both classes the span carries
  (.docs-external-link.docs-faceted-list-item-text), so the icon lines up
  with the chevrons at the link's end-padding. Using :host was avoided
  because it breaks the nested `a:hover &` selector.
2026-06-30 17:23:26 -07:00
yamanerkam e77a8a0c7a fix(docs-infra): align the page title with its edit action
The page title row (`.docs-page-title`) relied on the default flex
alignment, so the edit icon next to the title did not line up with the
title text. Add `align-items: baseline` so the icon sits on the title's
baseline.
2026-06-18 14:06:22 -04:00
yamanerkam ffcc8eee98 fix(docs-infra): correct select dropdown scrolling, sizing, and selection
Several issues in the shared docs `Select` component (used by the API
reference package filter):

- The options list never scrolled: its element used a class with no styles,
  so the intended max-height/overflow rule was dead. Point it at the styled
  class so long lists scroll within the popover.
- Selecting an option now closes the popup instead of leaving it open.
- Clip the trigger and popover corners (overflow: hidden) so their rounded
  borders render cleanly, and align the popover width with the trigger.
- Drop the selected-option checkmark. The component is single-select and
  already marks the selection with a highlight, so the tick was misleading.
- Remove the unused `disabled` input.
2026-06-18 10:52:35 -04:00
Kam 43acead06d fix(docs-infra): use a facade for docs-video to fix Firefox embeds
Follow-up to #69205. After switching adev's COEP to `credentialless`, the
cross-origin YouTube iframe in `<docs-video>` loads in Chromium and Safari but
not Firefox, whose `credentialless` policy does not extend to nested frames. The
result was a COEP error screen instead of the player.

Render `<docs-video>` as a lightweight thumbnail facade instead of embedding the
iframe directly. The thumbnail is a cross-origin subresource, so it loads under
`credentialless` in every browser. `DocViewer` then upgrades the facade to the
inline player on hydration in browsers that can load the embed (Chromium,
Safari), preserving the previous behavior there. On Firefox the facade stays a
plain link that opens the video on YouTube (with autoplay), which replaces the
error screen.

The thumbnail uses `maxresdefault` and falls back to `hqdefault` when a video
has no max-resolution image.
2026-06-15 08:58:00 -07:00
Matthieu Riegler 59e2041847 docs(docs-infra): Update navigation status 2026-06-11 09:24:28 -07:00
Kam 34d577f697 refactor(docs-infra): extract magic 27 in navigation-list tooltip threshold
The matTooltip on navigation list items was disabled when the label was
shorter than the literal `27`, repeated across four bindings in the
template. Lift the value to a protected readonly field so the threshold
has a name and lives in one place.
2026-05-28 16:08:08 +02:00
Matthieu Riegler f05d675651 build: update cross-repo angular dependencies (main)
This PR also replaces the implementation of the select component on ADEV due to the aria breaking changes
2026-05-12 16:41:38 -07:00
SkyZeroZx a0b998e293 docs(docs-infra): use signals & improve types
Use signals to avoid markForCheck.

Simplify takeUntilDestroyed usage by relying on implicit DestroyRef.

Improve type safety by typing inject(ElementRef).
2026-05-07 18:17:29 -06:00
Kam 441a00d665 fix(docs-infra): keep mobile nav drawers usable on small screens
On phones, opening the primary-nav drawer left the page behind it scrollable, and the secondary drawer's mask had no explicit height so long submenus got clipped above the page content. Lock the page with overflow: clip on :host:has(.adev-nav-primary--open) for phone-only (preserves the primary nav's sticky context), give the secondary mask height: 100dvh on tablet-landscape-down so it fills the visible viewport, and align the nav-list :host height to 100dvh too so its inner scroll matches.
2026-05-05 09:31:26 -07:00
Angular Robot c7518a4ed6 build: update cross-repo angular dependencies
See associated pull request for more information.

Closes #67980 as a pr takeover
2026-04-08 11:04:49 -07:00
Kam 8132a96884 docs(docs-infra): preserve navigation origin when clicking cross-category links
When a sidebar item links to a page in a different category (e.g., Route
transition animations under Animations links to a Routing page), clicking
back navigates to the main menu instead of the originating category.

Store the originating category in NavigationState when clicking a
cross-referenced item, so the back button returns to the correct section.
2026-04-07 09:46:18 -07:00
funsaized d95e856a25 fix(docs-infra): align search result icon with text on mobile
On narrow viewports, the search result icon was pushed to its own flex line when the title text was too long, causing vertical misalignment.

The fix wraps the title text and package badge in a single container that manages its own flex layout, preventing the icon from being separated from the text on narrow viewports.

Fixes #68005
2026-04-06 10:57:09 -07:00
SkyZeroZx ff2ba7c864 docs(docs-infra): replace wait with debounce for search
Replaces custom search debounce with `debounced`
2026-03-27 13:57:15 +01:00
Matthieu Riegler 1938054f34 docs(docs-infra): remove explicit OnPush 2026-03-25 12:58:39 -07:00
SkyZeroZx 1771d54fb7 docs(docs-infra): fixed missing gray color palette definitions for light and dark modes
Adds the missing gray color palette definitions for both light and dark modes
2026-02-19 08:54:57 -08:00
Matthieu Riegler bd1cdac54d docs(docs-infra): new homepage 2026-02-18 07:10:53 -08:00
SkyZeroZx 70615117a2 feat(docs-infra): Implements select component using Angular Aria
Replaces the native select element with a custom combobox implementation for improved accessibility and styling.
2026-02-02 11:07:53 -08:00
Shuaib Hasan Akib 6990f88d97 feat(docs-infra): increase table-of-contents width for large screens
Add media query overrides to expand the table-of-contents width on extra-large desktops.

fixes: #66823
2026-01-29 12:24:00 -08:00
Matthieu Riegler 4ca2722d6f docs(docs-infra): fix regression on docs-tabs 2026-01-21 12:43:04 -08:00
Kristiyan Kostadinov 94a8f797e5 fix(docs-infra): don't use private symbol
Fixes that the tab group was referring to a private symbol from the CDK.
2026-01-20 16:15:19 -08:00
Kristiyan Kostadinov 508d9c34d5 fix(docs-infra): use components directly
Switches the Material and CDK components to be used directly, instead of using the modules. This allows better diagnostics for unused directives.
2026-01-20 16:14:46 -08:00
SkyZeroZx 074666b2e8 docs(docs-infra): use Signals Forms focusBoundControl
Removes direct `ViewChild` access from `TextField` components and relies on
Signals Forms via the `focusBoundControl`  to manage focus.
2026-01-14 08:00:45 -08:00
Miles Malerba 5671f2cc07 fix(forms): Rename signal form [field] to [formField]
This completes the rename started in #66136. `[field]` is too generic of
a selector for the forms system to own, and likely to cause naming
collisions with existing components. Therefore it is being renamed to
`[formField]`
2026-01-09 14:33:09 -08:00
Matthieu Riegler b17f93b6d1 docs(docs-infra): Use category for signal forms guides 2026-01-07 09:35:19 -05:00
Matthieu Riegler 15308149db docs(docs-infra): Add package filter to the API list
This commit also introduces the usage of signal forms on adev
2026-01-05 15:21:33 -05:00
Matthieu Riegler 3a85031dc0 docs(docs-infra): Modernize tests
Remove usages of `detectChanges` and rely on `whenStable`.
This commit also removed the usage of `provideZonelessChangeDetection` which is no longer necessary.
2026-01-05 11:47:08 -05:00
SkyZeroZx e409757208 docs(docs-infra): fixes copy-to-clipboard icon moves to a new line for long heading text
Fixes an issue where the copy-to-clipboard icon moves to a new line when heading text is long and wraps.
Applies improved text wrapping for headings to keep the icon visually aligned.

Fixes #66239
2026-01-02 08:24:39 +01:00
SkyZeroZx 3b73eff0b4 docs(docs-infra): apply OnPush change detection and remove redundant root provider
Adds OnPush change detection and removes a redundant `providedIn: 'root'` injection token.
2026-01-02 08:23:20 +01:00
Matthieu Riegler af77b89e2a ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 09:24:36 -08:00
Matthieu Riegler 3411638f65 docs(docs-infra): prefer/avoid code block styling
fixes #65866
2025-12-09 09:23:12 -08:00
Joey Perrott 349133374f build: update repository to use node 22.21.1 in bazel
The repository was updated to use node 22.21.1 via nvm, but bazel had not been updated to match
2025-12-09 09:19:13 -08:00
Matthieu Riegler 9d1d742f1b build: enable angular formatting on all html files
This should also be safe on any html file that isn't an angular template
2025-12-08 10:19:45 -08:00
Miles Malerba cda56db20f test: fix broken adev tests
Fixes a broken adev tests and enables another one that seems to work
fine now
2025-12-08 09:04:50 -08:00
SkyZeroZx a4563044ad docs(docs-infra): fix hideCopy option to code snippets
Adds the ability to hide the copy button on code snippets.

Updates documentation to use the new `hideCopy` option with the new
markdown code fence syntax.
2025-12-08 08:48:20 -08:00
SkyZeroZx 4e89bc6244 feat(docs-infra): Adds copy link to anchor functionality
Enables copying a direct link to any section by clicking its anchor. Also updates the aria-label to remove the code tag
2025-12-01 19:19:31 +01:00
Shuaib Hasan Akib 313454bf17 fix(docs-infra): truncate long TOC items and add title tooltips
Long TOC entries now truncate with …, and a title attribute is added to display the full label on hover.

Fixes: #65727
2025-12-01 18:43:46 +01:00
Matthieu Riegler 1c3868198e docs(docs-infra): fix visible lines/regions
fixes #65552
2025-11-26 13:43:37 -05:00
Shuaib Hasan Akib b26fe73a91 docs(docs-infra): keep 'Show code' button aligned right and prevent metadata wrapping
Ensures the example viewer header displays correctly by keeping the "Show code"
button aligned to the right and preventing metadata text from wrapping.
Improves layout consistency across documentation examples.
2025-11-24 12:23:36 -05:00
Matthieu Riegler 119c6ddaeb docs(docs-infra): simplify tab selection
Tab selection relied on the tabs being visible whe nthe example is loaded. That didn't work when `hideCode` was used.

fixes #65550
2025-11-24 10:24:39 -05:00
Kristiyan Kostadinov 26e2092dd1 test: remove unnecessary test calls
Removes calls to `TestBed.configureTestingModule` since they aren't necessary.
2025-11-24 10:18:18 -05:00
Joey Perrott f61e61ac4f refactor(docs-infra): remove the multiple code example view modes
Rather than using multiple view modes for code examples, we can just treat the previous snippet mode as
as multifile mode that just only has one file in it.
2025-11-21 13:22:00 -05:00