You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(settings): group agent profiles by device - #360
Group Agent Profiles by device and separate device management from Agent preferences. This is a standalone, single-commit PR based on current main; it excludes unrelated alpha history and does not repeat the device rename implementation already merged in #347.
Keep online and offline Profiles under their devices, with persistent folding and direct Edit/Delete actions.
Show Connect for the disconnected local desktop device, Not connected for other offline devices, and Disconnect in the local device menu.
Add a device-fixed, progressive Agent catalogue and configuration flow, preserving drafts when changing harnesses.
Avoid unsupported-capability warning flashes while editing and false refresh-failure messages during successful saves; failed post-save refreshes retry without creating duplicate Profiles.
Update architecture documentation and remove obsolete UI labels and test mocks.
Contracts and compatibility
GET /api/acp/profiles adds optional, display-only knownDevices metadata. Runtime availability and placement still use connected devices; Chat, Ink, and Utility Agent selection behavior is unchanged. Offline display metadata does not authorize connections or execution.
The migration preserves mainline desktop preference synchronization and uses its accessible semantic foreground tokens. It includes the post-mutation snapshot serialization needed by the save/retry flow, but does not import the separate alpha batch-discovery feature or its endpoint.
Validation
pnpm typecheck passed across the repository after restoring mainline dependencies with pnpm install --frozen-lockfile; no dependency manifests or lockfile changed.
pnpm format and pnpm lint:fix completed without additional file changes. Lint reports 350 warnings and zero errors.
104 targeted web unit tests passed, covering Settings navigation, device grouping, local connection state, editor capabilities, drafts, save/retry feedback, catalogue loading, and the shared Profile store.
All 40 Profile-route tests passed.
All 9 Playwright tests in device-agent-settings.spec.ts and settings-components.spec.ts passed, including pointer/touch flows, rename, offline groups, delayed capability loading, and text contrast of at least 4.5:1 across light/dark themes.
Localization parity, source license headers, and git diff --check passed.
Remaining limitations
Browser tests render production components with simulated device/desktop IPC data. Real Windows/macOS connection lifecycle and native confirmation dialogs were not validated on physical devices. Narrow-screen name truncation is unchanged. The full repository test suite was not run; validation targets the changed surfaces. No release is included.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved bugs leave hidden icon pickers interactive, strand keyboard focus when switching to the chooser, and drop runtime version metadata for disconnected local devices after a server restart.
This PR reorganizes Settings around device-grouped Agent Profiles, separating device management from Agent preferences while preserving existing runtime selection behavior.
Changes:
Group online and offline Profiles by device, with folding, direct actions, and local desktop connection controls.
Add a device-fixed creation flow with preserved harness drafts, capability-aware controls, and refresh-only retries after successful saves.
Extend display-only device metadata and update documentation, localization, and tests.
File
Description
packages/shared/src/types/api/acp.ts
Define optional known-device metadata.
docs/architecture/agent-profiles.md
Document grouped Settings and save/retry behavior.
apps/web/src/utils/agentletDevice.ts
Generalize device resolution for display metadata.
apps/web/src/store/settingsUiStore.ts
Add the Agent settings tab identifier.
apps/web/src/store/acpProfilesStore.ts
Store known devices and serialize post-mutation refreshes.
The reason will be displayed to describe this comment to others. Learn more.
Verified again on the latest branch: this is fixed by 15c3fd3. DropdownMenu now registers its trigger as Popover.owner independently of floating positioning, and dismissPopoversWithin checks that owner. The production-browser regression opens the avatar dialog, keyboard-activates the device fold, asserts that the portal is removed and focus stays on the fold button, then re-expands and asserts the picker does not reopen. This passed again in the 10-test Settings browser run. No additional avatar change was needed.
Keep dropdown ownership independent of positioning, restore chooser focus when detection loses the selection, and fill missing local device metadata without changing availability.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Activating Disconnect with the keyboard closes the menu without restoring focus, leaving focus on the document body even if the confirmation is cancelled.
Closing this menu through dismissPopoversWithin reports ancestor-hidden, which deliberately disables DropdownMenu's focus restoration. If Disconnect is activated with the keyboard, its focused menu item is removed and focus falls back to the document body; cancelling the native confirmation does not restore it either. Close through a controlled menu action and restore focus to the visible device-menu trigger, or to Connect if the legacy standalone menu disappears after disconnect.
Close device menus through controlled state and restore Connect focus when legacy menus disappear. Cover cancellation, errors, success, and preserved Rename behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixed the newly reported Disconnect focus issue in df9af4d. Device menus now close through controlled open state, preserving DropdownMenu focus restoration after cancellation, failure, and success. Legacy bridges without a device identity fall back to Connect when their menu disappears, without stealing focus from another control. Controlled Rename also closes its menu before editing. Regression tests reproduced all six identity/outcome combinations before the fix and now pass; the browser suite covers keyboard cancellation/success and the previously fixed avatar folding. Repository format, lint:fix (existing warnings only), and typecheck passed; all 10 Settings browser tests passed. Native Electron confirmation is simulated through the IPC fixture, not real-device tested.
If a device disconnects and reconnects between snapshot polls, this key stays unchanged: LiveAgentletConnection.handleReconnect() retains the constructor's connectedAt value (external/agenetes/packages/agentlet-gateway/src/connection.ts:169–186). Discovery therefore keeps the previous connection's catalogue or error, potentially leaving stale capability controls until an explicit recheck or reopening the editor. Expose a connection generation or timestamp that advances on reconnect and use it in this key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Group Agent Profiles by device and separate device management from Agent preferences. This is a standalone, single-commit PR based on current
main; it excludes unrelatedalphahistory and does not repeat the device rename implementation already merged in #347.Contracts and compatibility
GET /api/acp/profilesadds optional, display-onlyknownDevicesmetadata. Runtime availability and placement still use connected devices; Chat, Ink, and Utility Agent selection behavior is unchanged. Offline display metadata does not authorize connections or execution.The migration preserves mainline desktop preference synchronization and uses its accessible semantic foreground tokens. It includes the post-mutation snapshot serialization needed by the save/retry flow, but does not import the separate
alphabatch-discovery feature or its endpoint.Validation
pnpm typecheckpassed across the repository after restoring mainline dependencies withpnpm install --frozen-lockfile; no dependency manifests or lockfile changed.pnpm formatandpnpm lint:fixcompleted without additional file changes. Lint reports 350 warnings and zero errors.device-agent-settings.spec.tsandsettings-components.spec.tspassed, including pointer/touch flows, rename, offline groups, delayed capability loading, and text contrast of at least 4.5:1 across light/dark themes.git diff --checkpassed.Remaining limitations
Browser tests render production components with simulated device/desktop IPC data. Real Windows/macOS connection lifecycle and native confirmation dialogs were not validated on physical devices. Narrow-screen name truncation is unchanged. The full repository test suite was not run; validation targets the changed surfaces. No release is included.