Skip to content

feat(react-headless-components-preview): add TeachingPopover #36205

Open
mainframev wants to merge 6 commits into
microsoft:masterfrom
mainframev:feat/headless-add-teaching-popover
Open

feat(react-headless-components-preview): add TeachingPopover #36205
mainframev wants to merge 6 commits into
microsoft:masterfrom
mainframev:feat/headless-add-teaching-popover

Conversation

@mainframev
Copy link
Copy Markdown
Contributor

@mainframev mainframev commented May 13, 2026

Adds a new headless TeachingPopover exposed at the
@fluentui/react-headless-components-preview/teaching-popover subpath

How it composes

  • useTeachingPopover builds on the headless usePopover and defaults
    withArrow: true to match the v9 component.
  • Sub‑components re‑export the v9 *Base_unstable hooks introduced in feat(react-teaching-popover): add base hooks and export them #36200
    (useTeachingPopoverHeaderBase_unstable, useTeachingPopoverTitleBase_unstable,
    useTeachingPopoverFooterBase_unstable, useTeachingPopoverCarouselBase_unstable,
    etc.), keeping all behavior (dismiss handlers, finish handlers, carousel state
    machine) while dropping the styled appearance, default icons, and primary /
    secondary Button slots.
  • renderTeachingPopover bridges the headless PopoverProvider and the v9
    PopoverProvider so v9 base sub‑hooks can read context transparently.
  • TeachingPopoverFooter ships a local render that emits only <state.root />
    (no primary / secondary Button slots — consumer composes any buttons).
  • TeachingPopoverCarouselFooter ships a local hook + render returning only
    { root } for the same reason.

Not in scope

  • No styling shipped from the library (intentional — headless package contract).
  • appearance, trapFocus (TBA), and inline props from the v9 component are
    intentionally dropped

Stories

Two stories under stories/src/TeachingPopover/:

  • Default — header (icon + label + dismiss), media placeholder, title, body,
    primary + secondary footer.
  • WithCarousel — three‑card tour with nav buttons, page count, and prev / next
    controls.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-headless-components-preview
react-headless-components-preview: entire library
157.538 kB
44.675 kB
177.342 kB
50.875 kB
19.804 kB
6.2 kB

🤖 This report was generated against 1d15557476d0e1eafbddd55c318d94bccd289a24

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@mainframev mainframev force-pushed the feat/headless-add-teaching-popover branch from 086563e to 67884ed Compare May 18, 2026 10:41
@mainframev mainframev marked this pull request as ready for review May 18, 2026 11:34
@mainframev mainframev requested a review from a team as a code owner May 18, 2026 11:34
@mainframev mainframev requested a review from dmytrokirpa May 19, 2026 12:10
Copy link
Copy Markdown
Contributor

@dmytrokirpa dmytrokirpa left a comment

Choose a reason for hiding this comment

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

LGTM, a few things are needed before the merge:

  • bundle-size stats, to ensure we don't pull unnecessary deps;
  • tests - currently none, we need to add some, at least top-level component e2e and unit for differences from core implementation

* Derived from the v9 `useTeachingPopoverCarouselContextValues_unstable` return
* type, which is the package's public contract for this shape.
*/
export type TeachingPopoverCarouselContextValues = ReturnType<typeof useTeachingPopoverCarouselContextValues_unstable>;
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.

is it not exported so we need to infer it?

Copy link
Copy Markdown
Contributor Author

@mainframev mainframev May 26, 2026

Choose a reason for hiding this comment

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

exactly, for sake of simplicity of current PR decided to infer. We can improve that in a follow-up by exporting it from the v9 TeachingPopover


export type TeachingPopoverCarouselFooterProps = ComponentProps<TeachingPopoverCarouselFooterSlots>;

export type TeachingPopoverCarouselFooterState = ComponentState<TeachingPopoverCarouselFooterSlots>;
Copy link
Copy Markdown
Contributor

@dmytrokirpa dmytrokirpa May 25, 2026

Choose a reason for hiding this comment

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

Original footer component had also primary/secondary button slots, why did you skip them?

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.

it might be redundant for headless, but re-added for better parity with v9, good call

@mainframev mainframev force-pushed the feat/headless-add-teaching-popover branch from 4937e80 to dbbda65 Compare May 26, 2026 14:06
@mainframev mainframev force-pushed the feat/headless-add-teaching-popover branch 4 times, most recently from b2f3935 to 719e7e4 Compare May 26, 2026 22:04
@mainframev mainframev force-pushed the feat/headless-add-teaching-popover branch from 719e7e4 to d363959 Compare May 26, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants