feat(ui-react): add device chooser for cloud free-tier device limit#6279
Conversation
|
Claude finished @luizhf42's task in 7m 18s —— View job Code Review CompleteReviewed 14 files across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo verification against the cloud backend). 1 inline issue posted (medium severity). All five review dimensions passed cleanly except for one test that passes trivially without exercising its stated behavior (Home key navigation). The architecture agent confirmed that API contracts ( Overall this is a well-structured PR — good separation between trigger gating and dialog logic, proper loading guards to prevent modal flash, correct accessibility patterns (ARIA tabs, live regions), and thorough test coverage (78 tests). If you've addressed the feedback and want a new review, tag |
bad4b9d to
cfc2c91
Compare
|
/review |
|
Claude finished @otavio's task in 1m 10s —— View job Code Review CompleteReviewed 14 files across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo verification against the Cloud backend) — no issues found. The code looks good as-is. Review details
If you push additional changes and want a new review, tag |
|
Could you do a rebase, so we do a new review round? |
cfc2c91 to
aa85321
Compare
|
/review |
|
Claude finished @otavio's task in 10m 0s —— View job Code Review CompleteReviewed 13 files across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo verification against the Cloud backend). 1 inline issue posted (medium severity). Review details
If you've addressed the feedback and want a new review, tag |
aa85321 to
e7805d5
Compare
|
/review |
|
Claude finished @otavio's task in 26m 37s —— View job Code Review CompleteReviewed 13 files across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo verification against the Cloud backend). 1 inline issue posted (medium severity). Review details
If you've addressed the feedback and want a new review, tag |
When a Cloud namespace owner exceeds three accepted devices without an active subscription, surface a forced modal to either subscribe or pick three devices to keep accepted; the rest are demoted to pending by the existing /api/billing/device-choice endpoint. Extract OnlineDot, LastSeenCell, useDebouncedValue, and normalizeDevice for reuse with the devices page.
e7805d5 to
3bb0c42
Compare
|
/review |
|
Claude finished @otavio's task in 1m 15s —— View job Code Review CompleteReviewed 13 files across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo verification against the Cloud backend) — no issues found. The code looks good as-is. Review details
If you push additional changes and want a new review, tag |
What
Port the Vue UI's device chooser to the React UI: when a Cloud namespace owner exceeds the free-tier three-device cap without an active subscription, present a forced modal to either subscribe or pick three devices to keep accepted; the rest are demoted to pending by the existing
/api/billing/device-choiceendpoint.Why
Closes the last open Device-Management gap on the React UI parity report (shellhub-io/team#91). Without this surface, free-tier Cloud namespaces that exceed the cap leave the owner with no UI to recover — they cannot accept new devices and have no way to pick which to keep short of calling the API directly.
Changes
device:choosepermission +!namespace.billing.active+stats.registered_devices > 3, with a loading guard so the modal cannot flash for paying customers during the namespace fetch race. Dismissal does not persist — reopens on next fresh mount, matching Vue.NormalizedDeviceshape through the now-exportednormalizeDevice. Suggested preselects the top three devices by session count from/api/billing/devices-most-used. All has hostname search (debounced), 5-per-page pagination, hard cap of three selections, and a chip strip surfacing the current selection across pages so picks cannot be silently lost when paginating or searching. Footer: Cancel / Subscribe (navigates to/settings#billing) / Accept. ESC and backdrop are blocked while the mutation is in flight; double-clicks are guarded by a ref.OnlineDotandLastSeenCelltocomponents/common/so the chooser and the main devices table render device status identically.useDebouncedValuefrom the inline pattern inpages/devices/index.tsx; both surfaces use it now.FREE_TIER_DEVICE_LIMITlives intypes/billing.ts, replacing two unrelated3constants.useDevices: gained anenabledoption so the dialog skips the All-tab query while the user is on Suggested.Testing
useDebouncedValuehook.pending(notremoved), dashboard refetches, modal does not reopen on reload. Log in as non-owner → no modal. Activate billing in Mongo → no modal. Run on CE → no modal.