-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1568): migrate app launcher notifications from Lit to React #4617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(FR-1568): migrate app launcher notifications from Lit to React #4617
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.72% | 547/11582 |
| 🔴 | Branches | 3.85% | 314/8157 |
| 🔴 | Functions | 2.92% | 104/3562 |
| 🔴 | Lines | 4.67% | 529/11323 |
Test suite run success
125 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from 77e1ef1
3baa86c to
e921bc1
Compare
There was a problem hiding this 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 migrates the app launcher notification system from Lit-based lablup-notification to a React-based notification system in Backend.AI. The changes unify notification management by using a shared notification key (session-app-${sessionUuid}) between React and Lit components, enabling real-time progress tracking (10% → 20% → 50% → 100%) with status transitions (pending → succeeded/failed).
Key changes:
- Added
backgroundTaskproperty tolablup-notification.tsfor progress tracking - Updated
backend-ai-app-launcher.tsto use notifications instead of indicators with consistent error handling - Modified React components (
AppLauncherModal.tsx,useBackendAIAppLauncher.tsx) to create initial notifications before Lit component takes over - Added "LunchingApp" translation key across 20+ language files
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 25 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/lablup-notification.ts | Added backgroundTask property and conditional rendering logic to support progress indicators |
| src/components/backend-ai-app-launcher.ts | Replaced indicator-based progress tracking with notification system using backgroundTask and unified notification keys |
| react/src/hooks/useBackendAIAppLauncher.tsx | Added notification creation in runTerminal function with session info and app name |
| react/src/components/ComputeSessionNodeItems/AppLauncherModal.tsx | Added notification setup before app launch, converted button to async BAIButton with proper state cleanup |
| resources/i18n/*.json (20+ files) | Added "LunchingApp" translation key for app launch notification message |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1b298ed to
004bc3f
Compare
agatha197
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
004bc3f to
224ce44
Compare
224ce44 to
396594c
Compare
396594c to
371699f
Compare
yomybaby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge activity
|
…4617) Resolves #TBD ([FR-1568](https://lablup.atlassian.net/browse/FR-1568)) ## 📋 Overview Migration of the app launcher notification system from Lit-based (`lablup-notification`) to React-based notification system in Backend.AI. ## 🔄 App Launch & Notification Flow ### 1. **App Launch Request Initiation** (React → Lit) **`AppLauncherModal.tsx` (lines 108-133)** - Create notification in React component with session info and app name - Call Lit component's `_runApp` with unified notification key ### 2. **App Launch Process** (Lit Component) **`backend-ai-app-launcher.ts`** updates notification at each stage during app launch: #### Phase 1: Initial Setup (lines 1251-1255) - Start backgroundTask at 10% - Status: `pending` #### Phase 2: Proxy Configuration - **V1 Proxy** (lines 715-720): Progress at 20% - **V2 Proxy** (lines 773-780): Error handling with `status: 'failed'` #### Phase 3: Socket Queue Addition (lines 902-909) - Progress at 50% - Adding kernel to socket queue #### Phase 4: App Launch Completion (lines 1375-1387) - Progress at 100% - Status: `succeeded` - Update notification after showing TCP app dialogs (SSH, VNC, etc.) #### Phase 5: Final Cleanup (lines 1447-1451) - Final notification display in finally block ### 3. **Error Handling** Notification alerts users on errors: - Proxy setup failure (lines 697-702, 727-734) - Session creation failure (lines 821-826) - Service port unavailable (lines 835-841) - Connection failure (lines 916-930) ## 🎯 Key Changes 1. **Unified Notification Key**: - Shared key (`session-app-${sessionUuid}`) between React and Lit components for state synchronization 2. **Progress Tracking**: - Visual progress via `backgroundTask` property (0% → 10% → 20% → 50% → 100%) - Status transitions: `pending` → `succeeded` or `failed` 3. **Error Handling**: - Updates to `status: 'failed'` on failure at any stage - User-friendly error messages ## 📝 Review Points - Notification state synchronization between React and Lit components - Prevention of duplicate notifications using shared notification key - Real-time progress updates for improved UX - Clear feedback on error occurrences ## ✅ Testing - [x] App launch notifications appear correctly - [x] Progress indicators update during app launch - [x] Error states display appropriate messages - [x] No duplicate notifications with same key - [x] Backward compatibility maintained [FR-1568]: https://lablup.atlassian.net/browse/FR-1568?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
371699f to
77e1ef1
Compare

Resolves #TBD (FR-1568)
📋 Overview
Migration of the app launcher notification system from Lit-based (
lablup-notification) to React-based notification system in Backend.AI.🔄 App Launch & Notification Flow
1. App Launch Request Initiation (React → Lit)
AppLauncherModal.tsx(lines 108-133)_runAppwith unified notification key2. App Launch Process (Lit Component)
backend-ai-app-launcher.tsupdates notification at each stage during app launch:Phase 1: Initial Setup (lines 1251-1255)
pendingPhase 2: Proxy Configuration
status: 'failed'Phase 3: Socket Queue Addition (lines 902-909)
Phase 4: App Launch Completion (lines 1375-1387)
succeededPhase 5: Final Cleanup (lines 1447-1451)
3. Error Handling
Notification alerts users on errors:
🎯 Key Changes
Unified Notification Key:
session-app-${sessionUuid}) between React and Lit components for state synchronizationProgress Tracking:
backgroundTaskproperty (0% → 10% → 20% → 50% → 100%)pending→succeededorfailedError Handling:
status: 'failed'on failure at any stage📝 Review Points
✅ Testing