Skip to content

feat: add resive observer of Notification and content with ref to wra…#389

Merged
Qbit982 merged 4 commits into
mainfrom
feat_RESIVE_OBSERVER_IN_NOTIFICATION
Jun 2, 2026
Merged

feat: add resive observer of Notification and content with ref to wra…#389
Qbit982 merged 4 commits into
mainfrom
feat_RESIVE_OBSERVER_IN_NOTIFICATION

Conversation

@Qbit982

@Qbit982 Qbit982 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Fixes layout for notifications with dynamic content (expand/collapse): list item height is recalculated when the card resizes. Storybook includes an example with autoscroll on collapse for looooong content.

@gravity-ui-bot

Copy link
Copy Markdown
Contributor

Preview is ready.

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

The Archive action has lost animation — needs fixing

Image

I'm not sure how to reproduce though
I somehow Archived without seeing animation, but now, after refresing the page, I can't reproduce it anymore

@Qbit982

Qbit982 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Fix the problem that side notifications actions does not hidden after unhover + fix the problem with achrive notifications (visal)

{Array.from({length: 20}, (_, index) => (
<i key={index}>{'Long expanded content. '}</i>
))}
<Button view="flat-secondary" onClick={handleCollapse}>

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.

I think you should use Disclosure here

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.

If that's complicated, then maybe we should reconsider how to handle notifications' resizing

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.

Changed to Disclosure

ref.current.style.transition = 'max-height 0.3s';
setWrapperMaxHeight(0);
requestAnimationFrame(() => {
requestAnimationFrame(() => {

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.

Let's leave an explanation comment for this

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.

Added the comment here

content: React.ReactNode;
content:
| React.ReactNode
| ((props: {rootRef?: React.RefObject<HTMLDivElement>}) => React.ReactNode);

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.

If I understood correctly, this is wrapperRef, is that right?

If so, then rootRef is kinda misleading.
It can mean Notifications ref or something like that

I suggest to use wrapperRef for this prop
But I'm not insisting on that

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.

Changed naming to wrapperRef

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

Seems good now

@Qbit982 Qbit982 merged commit f06e70d into main Jun 2, 2026
4 checks passed
@Qbit982 Qbit982 deleted the feat_RESIVE_OBSERVER_IN_NOTIFICATION branch June 2, 2026 15:12
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.

3 participants