Skip to content

Update widgets-scaffold to shared menu footer + useWidgetTelemetry#28

Open
IamDgrant618 wants to merge 2 commits into
mozilla:mainfrom
IamDgrant618:update-widgets-scaffold-shared-menu-telemetry
Open

Update widgets-scaffold to shared menu footer + useWidgetTelemetry#28
IamDgrant618 wants to merge 2 commits into
mozilla:mainfrom
IamDgrant618:update-widgets-scaffold-shared-menu-telemetry

Conversation

@IamDgrant618

Copy link
Copy Markdown

Bake the shared WidgetMenuFooter + SizeSubmenu (Bug 2046045 / D306294) and the useWidgetTelemetry hook into the widget scaffold, so a newly scaffolded widget gets the consistent context-menu footer (divider, Change size, Move, Hide widget, Learn more -> new tab) and shared telemetry by default instead of the old hand-rolled pattern that drifted out of sync.

  • ExampleWidget.jsx: render <WidgetMenuFooter sizeSubmenu={}>
    instead of the inline size submenu + MoveSubmenu + Hide + Learn more; use
    useWidgetTelemetry (impressionRef + recordUserAction) instead of hand-built
    WIDGETS_IMPRESSION / WIDGETS_USER_EVENT dispatches and useIntersectionObserver.
  • SKILL.md and notes.md: document the shared footer and telemetry hook; drop the stale useSizeSubmenu / MoveSubmenu / hand-rolled-observer guidance.

Bake the shared WidgetMenuFooter + SizeSubmenu (Bug 2046045 / D306294) and the
useWidgetTelemetry hook into the widget scaffold, so a newly scaffolded widget
gets the consistent context-menu footer (divider, Change size, Move, Hide
widget, Learn more -> new tab) and shared telemetry by default instead of the
old hand-rolled pattern that drifted out of sync.

- ExampleWidget.jsx: render <WidgetMenuFooter sizeSubmenu={<SizeSubmenu/>}>
  instead of the inline size submenu + MoveSubmenu + Hide + Learn more; use
  useWidgetTelemetry (impressionRef + recordUserAction) instead of hand-built
  WIDGETS_IMPRESSION / WIDGETS_USER_EVENT dispatches and useIntersectionObserver.
- SKILL.md and notes.md: document the shared footer and telemetry hook; drop the
  stale useSizeSubmenu / MoveSubmenu / hand-rolled-observer guidance.

Copilot AI 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.

Pull request overview

Updates the New Tab widget scaffolding skill to standardize newly scaffolded widgets on the shared context-menu footer components and the shared widget telemetry hook, replacing older per-widget hand-rolled patterns that drifted from product behavior.

Changes:

  • Update scaffold guidance to use WidgetMenuFooter + SizeSubmenu for the standardized trailing context-menu block.
  • Document and switch the reference widget telemetry wiring to useWidgetTelemetry (impression + user actions).
  • Refresh reference notes to remove stale useSizeSubmenu/hand-wired observer guidance.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
plugins/newtab/skills/widgets-scaffold/SKILL.md Updates the official scaffolding instructions to use shared menu footer + shared telemetry hook.
plugins/newtab/skills/widgets-scaffold/references/notes.md Refreshes reference notes to describe WidgetMenuFooter/SizeSubmenu and useWidgetTelemetry.
plugins/newtab/skills/widgets-scaffold/references/ExampleWidget/ExampleWidget.jsx Refactors the reference widget to use useWidgetTelemetry and the shared menu footer components.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/newtab/skills/widgets-scaffold/SKILL.md Outdated
Comment thread plugins/newtab/skills/widgets-scaffold/references/ExampleWidget/ExampleWidget.jsx Outdated
Comment thread plugins/newtab/skills/widgets-scaffold/references/ExampleWidget/ExampleWidget.jsx Outdated

@maxxcrawford maxxcrawford 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.

Good by new tab!

@IamDgrant618 IamDgrant618 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed copilot comments.

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.

4 participants