Skip to content

fix(ui): ensure unauthenticated miners can be selected and unpaired#290

Open
b-rowan wants to merge 2 commits into
block:mainfrom
b-rowan:fix/unpair-unauthenticated-miners
Open

fix(ui): ensure unauthenticated miners can be selected and unpaired#290
b-rowan wants to merge 2 commits into
block:mainfrom
b-rowan:fix/unpair-unauthenticated-miners

Conversation

@b-rowan
Copy link
Copy Markdown

@b-rowan b-rowan commented May 21, 2026

This is a bit more verbose than I would like, and there may be better ways to do this, but my experience with typescript is pretty limited. Tested and working, this may affect cases outside the issue specific case, but I think that is generally expected behavior, EG I should always be able to remove a device no matter what state its in, as removing and re-adding may solve some issues.

Fixes: #286

Fixes: block#286
Signed-off-by: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
@b-rowan b-rowan requested a review from a team as a code owner May 21, 2026 16:59
@github-actions github-actions Bot added javascript Pull requests that update javascript code client labels May 21, 2026
@rongxin-liu rongxin-liu self-assigned this May 21, 2026
@rongxin-liu rongxin-liu requested a review from Copilot May 21, 2026 17:06
Copy link
Copy Markdown
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 addresses issue #286 by changing ProtoFleet’s miner list selection behavior so miners in an AUTHENTICATION_NEEDED state remain selectable, enabling users to unpair them even when authentication fails.

Changes:

  • Decouples “row disabled for selection” from “row limited for actions” so auth-needed miners can still be selected.
  • Restricts bulk actions to Unpair when the current selection includes auth-needed miners (including “select all” mode).
  • Updates/extends UI tests to validate selectable auth-needed miners and the restricted bulk-action menu behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
client/src/protoFleet/features/fleetManagement/components/MinerList/MinerListActionBar.tsx Threads through a new flag indicating selection includes auth-needed miners.
client/src/protoFleet/features/fleetManagement/components/MinerList/MinerList.tsx Makes auth-needed rows selectable and computes a selection-level “includes auth-needed” signal.
client/src/protoFleet/features/fleetManagement/components/MinerList/MinerList.test.tsx Updates test to ensure auth-needed miners remain selectable and included via “Select all”.
client/src/protoFleet/features/fleetManagement/components/MinerActionsMenu/MinerActionsMenu.tsx Limits available bulk actions to Unpair when selection includes auth-needed miners.
client/src/protoFleet/features/fleetManagement/components/MinerActionsMenu/MinerActionsMenu.test.tsx Adds coverage for restricting actions to Unpair when auth-needed miners are selected.

@b-rowan
Copy link
Copy Markdown
Author

b-rowan commented May 21, 2026

This may have caused issues with unpairing devices, but I can't tell if that's because of these changes or because they're offline, I'll do more digging.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brett Rowan <121075405+b-rowan@users.noreply.github.com>
@b-rowan
Copy link
Copy Markdown
Author

b-rowan commented May 21, 2026

This may have caused issues with unpairing devices, but I can't tell if that's because of these changes or because they're offline, I'll do more digging.

I think this is unrelated, will open a separate issue:

Uncaught (in promise) TypeError: crypto.randomUUID is not a function
    t http://10.0.11.202/assets/BulkActions-CZbOy-3-.js:1
    w http://10.0.11.202/assets/BulkActions-CZbOy-3-.js:1
    yd http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:8
    wd http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:8
    _n http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:8
    wd http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:8
    up http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:9
    cp http://10.0.11.202/assets/vendor-react-BYKXDB4x.js:9
BulkActions-CZbOy-3-.js:1:28560

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82d59b9dd3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +300 to +301
selectionMode === "all"
? totalDisabledMiners > 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include selected rows in all-mode auth-needed detection

This all-mode branch trusts only totalDisabledMiners > 0, but that count is fed by a separate async query and is initialized/stale as 0 until it refreshes. If a user hits “Select all” before that count is ready (or during a stale window), selectionIncludesUnauthenticatedMiner becomes false even when the current selected rows already include AUTHENTICATION_NEEDED miners, so non-unpair bulk actions are exposed again. Please keep a fallback check against selectedMinerIds/deviceItems in all-mode so the restriction cannot be bypassed by timing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cannot unpair un-authenticated or partially set up miner

3 participants