Skip to content

Conversation

@yomybaby
Copy link
Member

@yomybaby yomybaby commented Oct 17, 2025

Resolves #4403 (FR-1560)

Summary

This PR implements auto-dismissing functionality for session "Running" notifications with a timeout animation. The notification now automatically closes after 10 seconds with a progress bar animation, and pauses when the user hovers over it.

Changes

  • Implemented auto-dismiss for "Running" status notifications with 10-second timeout
  • Added progress bar animation to show remaining time
  • Added pauseOnHover functionality to prevent auto-close on hover
  • Refactored to use useRefetchableFragment for cleaner implementation
  • Replaced manual fetch query with proper refetch mechanism
  • Used useEffectEvent for stable callback reference

Testing

  • Notification auto-dismisses after 10 seconds when session reaches "Running" state
  • Progress bar shows countdown animation
  • Auto-dismiss pauses when hovering over the notification
  • Other status notifications continue to work as before

Copy link
Member Author

yomybaby commented Oct 17, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.69% (+0% 🔼)
532/11355
🔴 Branches
3.78% (+0% 🔼)
302/7996
🔴 Functions 2.9% 102/3517
🔴 Lines
4.63% (+0% 🔼)
514/11096

Test suite run success

121 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 5488e1c

@ironAiken2 ironAiken2 changed the base branch from feat/FR-1318-add-run-model-button to graphite-base/4411 October 28, 2025 05:46
@agatha197 agatha197 requested a review from Copilot November 6, 2025 06:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the BAIComputeSessionNodeNotificationItem component to use modern React patterns and simplify the session status polling mechanism.

  • Replaced manual polling with useRefetchableFragment for better integration with Relay
  • Introduced useEffectEvent for notification updates without dependency tracking
  • Added React 19's 'use memo' directive for component memoization

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

Comment on lines 55 to 59
useEffect(() => {
if (
!node?.status ||
node?.status === 'TERMINATED' ||
node?.status === 'CANCELLED'
) {
setDelay(null);
} else if (node?.status === 'RUNNING') {
setDelay(15000);
} else {
setDelay(3000);
if (node?.status === 'RUNNING') {
closeNotificationWithProgress();
}
}, [node?.status]);
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The dependency array is incomplete. closeNotificationWithProgress should be included in the dependencies, or if using the experimental useEffectEvent, you need to ensure the React version supports it. With current stable React, this could cause stale closure issues where closeNotificationWithProgress references outdated values of notification or upsertNotification.

Copilot uses AI. Check for mistakes.
BAINodeNotificationItemProps
> = ({ sessionFrgmt, showDate, notification }) => {
const { destroyNotification } = useSetBAINotification();
'use memo';
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Unknown directive: 'use memo'.

Suggested change
'use memo';

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants