Skip to content

Conversation

@georgylobko
Copy link
Member

@georgylobko georgylobko commented Jan 7, 2026

Description

Introduced a new internal component FeaturePrompt as part of the feature notification pattern.

Related links, issue #, if available: n/a

How has this been tested?

U tests

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.15%. Comparing base (15e15bb) to head (028b5a5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4170   +/-   ##
=======================================
  Coverage   97.15%   97.15%           
=======================================
  Files         875      878    +3     
  Lines       25673    25716   +43     
  Branches     9293     9297    +4     
=======================================
+ Hits        24942    24985   +43     
- Misses        684      725   +41     
+ Partials       47        6   -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@georgylobko georgylobko marked this pull request as ready for review January 14, 2026 11:50
@georgylobko georgylobko requested a review from a team as a code owner January 14, 2026 11:50
@georgylobko georgylobko requested review from avinashbot and pan-kot and removed request for a team January 14, 2026 11:50
'charts.test',
'error-boundary/demo-async-load',
'error-boundary/demo-components',
'features-notifications',
Copy link
Member

Choose a reason for hiding this comment

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

nit: should the page name be "feature-notifications"?

</Box>
}
getTrack={() => document.querySelector('#settings-icon')}
trackKey="settings-icon"
Copy link
Member

Choose a reason for hiding this comment

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

nit: is the trackKey really needed here? For statically positioned prompts I don't think it is important.

/>
<AppLayout
ariaLabels={labels}
analyticsMetadata={{
Copy link
Member

Choose a reason for hiding this comment

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

nit: do we need metadata props on this page?

{ size = 'medium', position = 'top', ...rest }: FeaturePromptProps,
ref: React.Ref<FeaturePromptProps.Ref>
): JSX.Element => {
const baseComponentProps = useBaseComponent('FeaturePromptProps', { props: { size, position } });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const baseComponentProps = useBaseComponent('FeaturePromptProps', { props: { size, position } });
const baseComponentProps = useBaseComponent('FeaturePrompt', { props: { size, position } });

}));

return (
<span {...baseProps} className={clsx(styles.root)} ref={__internalRootRef}>
Copy link
Member

Choose a reason for hiding this comment

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

nit: no need to use clsx

}}
variant="annotation"
overflowVisible="content"
onBlur={() => {
Copy link
Member

Choose a reason for hiding this comment

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

Won't the onBlur also fire if the focus moves between focusable elements inside the feature prompt (e.g. when moving focus from the dismiss button to a link in the content)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Valid point. Yes, addressed

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

Copy link
Member

Choose a reason for hiding this comment

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

are these imports needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, they aren't needed. Removed

const baseProps = getBaseProps(restProps);
const [show, setShow] = useState(false);

const popoverBodyRef = useRef<HTMLDivElement | null>(null);
Copy link
Member

Choose a reason for hiding this comment

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

what is this one for?

Copy link
Member Author

Choose a reason for hiding this comment

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

for onBlur handling. btw, I have introduced this handling before, but didn't push here

overflowVisible="content"
onBlur={event => {
const relatedTarget = event.relatedTarget;
if (relatedTarget && popoverBodyRef.current?.contains(relatedTarget)) {
Copy link
Member

Choose a reason for hiding this comment

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

I think there is no need to pass the ref to the popover body - the same can be achieved by adding a div wrapper above the container and attach the ref there.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the difference between my approach and your suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

There is no functional diff - it just helps to keep the popover body api slightly simpler. It is up to you yo decide

Copy link
Member

Choose a reason for hiding this comment

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

The same applies to onBlur - it can technically be done outside, too.

@georgylobko georgylobko added this pull request to the merge queue Jan 15, 2026
Merged via the queue into main with commit 0f8232f Jan 15, 2026
84 of 85 checks passed
@georgylobko georgylobko deleted the feat/feature-prompt branch January 15, 2026 17:08
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.

2 participants