Commit c0130e5
committed
Resolves #6497 ([FR-2496](https://lablup.atlassian.net/browse/FR-2496)) — sub-task of [FR-2470](https://lablup.atlassian.net/browse/FR-2470).
Follow-up polish on the EduAppLauncher refactor stack. Three related improvements surfaced during manual testing of the completed FR-2483 → FR-2487 work.
## 1. New-window fallback UI (`EduAppLauncher.tsx`)
When the launch completes, the original code only auto-opens the app window. Browsers with popup blockers silently drop the `window.open` call. This PR:
- Stores the resolved `appConnectUrl` in the `done` stage so the UI knows where to navigate
- Adds a visible primary button ("If a new window did not open automatically, click here.") on the completion card
- Adds a secondary "Refresh page" action
## 2. Migrate to React Compiler + `useEffectEvent`
- Remove manual `useCallback` / `useMemoizedFn` wrappers now that the file uses the `'use memo'` directive (React Compiler memoizes automatically)
- Wrap the launch-effect body in `useEffectEvent` so the `useEffect` deps stay precisely `[active, apiEndpoint]` — no more `// eslint-disable-next-line react-hooks/exhaustive-deps`
- The `onLaunchEffect` block is placed **after** `_launch` is declared to respect the temporal-dead-zone rule (caught by `react-hooks/immutability` lint)
## 3. wsproxy `proxyURL` truthy-value hardening (`useBackendAIAppLauncher.tsx`)
Root-cause fix: the Backend.AI client initializes `_config.proxyURL = null` by default, and `config.toml` can ship `wsproxy.proxyURL = ""` for environments that rely on the local default. The previous `!== undefined` check let both null and empty-string pass through, which later crashed on `url.endsWith(...)`. Switch to a truthy check so both fall through to the default `http://127.0.0.1:5050/`.
Also adds structured debug logging through the wsproxy launch path (`getWSProxyVersion`, `getProxyURL`, `_launchApp`) so the version/URL/wsproxy response chain is observable from the browser console.
## 4. i18n
New keys `eduAppLauncher.OpenAppInNewWindow` and `eduAppLauncher.RefreshPage` added in all 21 supported languages.
## 5. New rule: `.claude/rules/use-effect-event.md`
Codifies when to reach for `useEffectEvent` over `useCallback` under the `'use memo'` directive. Captures the temporal-dead-zone gotcha that this PR itself tripped on.
## Out of scope
SSH/VS Code Desktop modal apps, Edu API runtime state handling (inherited from FR-2470 out-of-scope list).
## Test plan
- [ ] With a popup-blocker enabled: completion card shows the fallback button and it navigates correctly on click
- [ ] Without a popup-blocker: original `window.open` path still works; completion card still renders the fallback as a recovery option
- [ ] `config.toml` with `wsproxy.proxyURL = ""` no longer crashes; falls through to `http://127.0.0.1:5050/`
- [ ] `config.toml` with a real proxy URL still honors it
- [ ] Browser console shows the new `[wsproxy]` / `[_launchApp]` logs at `info` level
- [ ] No `useCallback` / `useMemoizedFn` regressions in `EduAppLauncher.tsx`
[FR-2496]: https://lablup.atlassian.net/browse/FR-2496?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[FR-2470]: https://lablup.atlassian.net/browse/FR-2470?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 64f61cb commit c0130e5
24 files changed
Lines changed: 705 additions & 199 deletions
File tree
- .claude/rules
- react/src
- components
- hooks
- resources/i18n
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
0 commit comments