Skip to content

feat(settings): a Devices tab — add, rename and remove computers from /settings - #2074

Merged
AbirAbbas merged 3 commits into
devfrom
feat/settings-devices-tab
Oct 30, 2026
Merged

AbirAbbas merged 3 commits into
devfrom
feat/settings-devices-tab

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Why

Device management was only reachable through /devices, /pair and codeaf devices revoke. Someone looking on the settings page found nothing. A teammate asked for add and remove "in tui settings… in devices category".

What

/settings gains a Devices tab between Connections and Privacy. It hosts the same deviceCard that /devices opens, rather than a second list:

  • the same rows, order and words: online and away dots, this device, seen 3h ago, removed. It reloads when another computer changes the device list.
  • r remove removes the computer under the cursor through the same door call. The row then reads removed and the foot line says <name> was removed — it can no longer reach your chats. On your own row, r says this device cannot remove itself — choose another row.
  • n rename renames this device inline. esc while typing cancels the name without closing /settings, and a second esc closes it.
  • Add another device (enter add) leaves settings and starts exactly what bare /pair starts. Its wording is now one constant shared with the home card.
  • Where pairing can't work, the tab shows the same one sentence /devices shows (pairing is not available here, the engine reason, or the read error). It never shows an empty list.
  • Settings search finds the tab for devices, remove, revoke, pair and add device.

Supporting changes:

  • Device messages now land on whichever view holds the card.
  • The presence feed stays joined while the tab is open.
  • The online dot now comes through the palette's glyph door instead of a literal ●. It is unchanged on Unicode and Nerd Font terminals; in ASCII it is now # beside o.

The manual gains Devices in /settings — … remove (revoke) one from settings, and every /settings tab list in the corpus now names Devices. Four new probes ("can I remove a device from settings", …) reach that section.

Validation contract → proof

Behavior Covered by
Tab sits between Connections and Privacy and is reached with ←/→ TestSettingsDevicesTabSitsBetweenConnectionsAndPrivacyAndIsReachedByTabKeys, TestSettingsOrganizationCategoriesAndAdvancedSearch
Lists devices exactly as /devices does, and refreshes on a directory change TestSettingsDevicesListsDevicesInCardOrderAndRefreshesOnDirectoryChange
Add row leaves settings and starts bare /pair TestSettingsDevicesAddRowLeavesSettingsAndStartsBarePair
r removes another device, refuses on your own row, does nothing on the add or removed rows TestSettingsDevicesRKeyRemovesAnotherRowRefusesOwnRowAndIgnoresAddAndRemovedRows
n renames; esc cancels typing without closing settings TestSettingsDevicesNKeyRenamesThisDeviceAndEscCancelsTypingWithoutClosingSettings
Keys line shrinks to what works on the row TestSettingsDevicesKeysLineShrinksToWhatWorksOnTheCurrentRow
Unavailable or failed read shows one sentence, no list TestSettingsDevicesUnavailableAndFailedReadSayWhyAndNothingElse
Search finds the tab TestSettingsDevicesSearchFindsTheTabAcrossQueries
The manual answers it four probes in internal/manual/chat_test.go

Hand test. I used the real binary in tmux. Two throwaway homes were paired through a local codeaf relay with codeaf pair --code. On home A, /settings → Devices showed both computers and the add row, with the keys line matching the /devices card row for row. n then esc cancelled the rename and stayed in settings, and a second esc closed it. Add another device showed a fresh pairing code. r on the other computer marked it removed, and codeaf devices on A confirmed the removal.

Local gates. go build ./..., go vet on the touched packages, gofmt, make test-laws, the manual, iconlaw and namelaw packages, and focused internal/tui3 runs over Settings, Devices, Pair, Manual, Home, Machine, Watch and Approve are all green. The full touched-package suites are left to CI.

🤖 Generated with Claude Code

AbirAbbas and others added 3 commits October 30, 2026 10:34
… /settings

Device management lived only behind /devices, /pair and the command line, so
someone looking for it on the settings page found nothing. /settings now has a
Devices tab between Connections and Privacy. It hosts the same deviceCard
/devices opens — the same rows, order, dots, key words and door calls — plus an
"Add another device" row that leaves settings and starts what bare /pair
starts. r removes the computer under the cursor, n renames this one, and esc
while typing a name cancels the name without closing settings. Where pairing
cannot work, the tab says the same one sentence /devices says.

The device messages now land on whichever view holds the card, the presence
feed stays joined while the tab is open, and the add-device words are one
shared constant with the home card. The online dot comes through the palette's
glyph door instead of a literal mark. The manual gains a section headed in the
asker's words, the settings tab lists in the corpus name Devices, and four
probes reach the new section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hand-testing on a home with CODEAF_SYNC_URL=off showed the tab lists no
computers and still offers Add another device, whose enter answers the same
sync-off refusal /pair gives. The section claimed only "one sentence and no
rows" for unusable states; it now says exactly what sync off does, and the
unusable-state sentence is tightened to keep the section standalone-short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit ce06d29 into dev Oct 30, 2026
7 checks passed
@AbirAbbas
AbirAbbas deleted the feat/settings-devices-tab branch October 30, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant