clauddy 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/accounts.js +13 -4
- package/main.js +17 -3
- package/package.json +1 -1
- package/preload.js +1 -0
- package/renderer/index.html +7 -8
- package/renderer/pet.js +113 -34
- package/renderer/style.css +124 -25
package/README.md
CHANGED
|
@@ -31,11 +31,11 @@ The token is saved locally (see [Data & privacy](#data--privacy)) and refreshed
|
|
|
31
31
|
|
|
32
32
|
### Several subscriptions
|
|
33
33
|
|
|
34
|
-
Got more than one Claude account — say a personal Pro and a Max from work?
|
|
34
|
+
Got more than one Claude account — say a personal Pro and a Max from work? The **account chip** in the top-left corner is the switcher: click it for the list of accounts, with the active one marked, plus **"+ Add another account"** — which opens the same browser login and drops the token it brings back into a new slot. The tray icon has the same list under its **Account** submenu. Give up halfway and the empty slot disappears on its own — the list only ever holds accounts you actually logged into.
|
|
35
35
|
|
|
36
36
|
The widget follows **one account at a time**: the one you pick is the one whose % is shown, whose logs are counted, and the only one that can notify you. Each account keeps its own token and its own armed alerts, so switching never replays a notification you already dismissed elsewhere. Everything else — window position, display mode, zoom, thresholds — is shared.
|
|
37
37
|
|
|
38
|
-
Removing an account deletes its token from disk. The
|
|
38
|
+
Removing an account (the **×** on its row) deletes its token from disk. The one you're currently on can't be removed — switch away first — and neither can the last one left. Removing the first account clears its token without touching the settings that live in the same folder.
|
|
39
39
|
|
|
40
40
|
> Prefer one widget per account instead? Setting `CLAUDE_CONFIG_DIR` still isolates a whole instance — token, settings and logs — so you can run two Clauddys side by side.
|
|
41
41
|
|
package/accounts.js
CHANGED
|
@@ -28,8 +28,10 @@ function sane(j) {
|
|
|
28
28
|
label: typeof a.label === 'string' && a.label ? a.label : null,
|
|
29
29
|
claudeDir: typeof a.claudeDir === 'string' && a.claudeDir ? a.claudeDir : null,
|
|
30
30
|
}))
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// the default account can be removed like any other, so it is only recreated
|
|
32
|
+
// when nothing is left — an empty list would leave the widget with no token
|
|
33
|
+
if (!list.length) list.push(defaults().accounts[0])
|
|
34
|
+
const active = list.some((a) => a.id === j?.active) ? j.active : list[0].id
|
|
33
35
|
return { active, accounts: list }
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -118,14 +120,21 @@ function setClaudeDir(id, dir) {
|
|
|
118
120
|
// behind would be a credential nobody can see or revoke from the UI
|
|
119
121
|
function remove(id) {
|
|
120
122
|
const s = load()
|
|
121
|
-
if (id === DEFAULT_ID) return false // the original install's data: never dropped
|
|
122
123
|
if (id === s.active) return false // switch away first: the widget is showing it
|
|
123
124
|
const i = s.accounts.findIndex((a) => a.id === id)
|
|
124
125
|
if (i < 0) return false
|
|
126
|
+
if (s.accounts.length < 2) return false // never leave the widget with no account
|
|
125
127
|
s.accounts.splice(i, 1)
|
|
126
128
|
save(s)
|
|
127
129
|
try {
|
|
128
|
-
|
|
130
|
+
if (id === DEFAULT_ID) {
|
|
131
|
+
// its folder is the app's own data dir: drop the credentials, not the
|
|
132
|
+
// settings, the account list or the simulator file that live beside them
|
|
133
|
+
for (const f of ['auth.json', 'alerts.json'])
|
|
134
|
+
fs.rmSync(path.join(dataDirOf(id), f), { force: true })
|
|
135
|
+
} else {
|
|
136
|
+
fs.rmSync(dataDirOf(id), { recursive: true, force: true })
|
|
137
|
+
}
|
|
129
138
|
} catch {}
|
|
130
139
|
return true
|
|
131
140
|
}
|
package/main.js
CHANGED
|
@@ -296,7 +296,7 @@ function hasToken(id) {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
function pruneEmpty(id) {
|
|
299
|
-
if (id === accounts.DEFAULT_ID || id === accounts.activeId()) return
|
|
299
|
+
if (id === accounts.DEFAULT_ID || id === accounts.activeId()) return // never auto-drop the original
|
|
300
300
|
const acc = accounts.list().find((a) => a.id === id)
|
|
301
301
|
if (!acc || acc.label || hasToken(id)) return
|
|
302
302
|
accounts.remove(id)
|
|
@@ -305,10 +305,20 @@ function pruneEmpty(id) {
|
|
|
305
305
|
ipcMain.on('accounts-switch', (_e, id) => switchAccount(String(id)))
|
|
306
306
|
// "add an account" *is* "log in": the browser opens on the new, empty slot, so
|
|
307
307
|
// the token lands in it and not in the account we just left
|
|
308
|
+
// the account an "add" left behind: cancelling the login has to land back on
|
|
309
|
+
// it, or the widget is stuck on an empty slot with no chip to switch from
|
|
310
|
+
let addedFrom = null
|
|
308
311
|
ipcMain.on('accounts-add', () => {
|
|
312
|
+
addedFrom = accounts.activeId()
|
|
309
313
|
switchAccount(accounts.add())
|
|
310
314
|
startLogin()
|
|
311
315
|
})
|
|
316
|
+
ipcMain.on('accounts-cancel-add', () => {
|
|
317
|
+
const from = addedFrom
|
|
318
|
+
addedFrom = null
|
|
319
|
+
if (!from || from === accounts.activeId() || hasToken(accounts.activeId())) return
|
|
320
|
+
switchAccount(from) // the empty slot is pruned on the way out
|
|
321
|
+
})
|
|
312
322
|
ipcMain.on('accounts-remove', (_e, id) => {
|
|
313
323
|
if (accounts.remove(String(id))) sendAccounts()
|
|
314
324
|
})
|
|
@@ -318,8 +328,11 @@ function createWindow() {
|
|
|
318
328
|
// a login abandoned in an earlier run: nothing stays pending across a restart,
|
|
319
329
|
// so fall back to the first account and let the empty slots go
|
|
320
330
|
const boot = accounts.active()
|
|
321
|
-
if (
|
|
322
|
-
|
|
331
|
+
if (!boot.label && !hasToken(boot.id)) {
|
|
332
|
+
// the default account can be gone by now, so land on whatever comes first
|
|
333
|
+
const fallback = accounts.list().find((a) => a.id !== boot.id)
|
|
334
|
+
if (fallback) accounts.setActive(fallback.id)
|
|
335
|
+
}
|
|
323
336
|
for (const a of accounts.list()) pruneEmpty(a.id)
|
|
324
337
|
applyAccount(accounts.active())
|
|
325
338
|
const { workAreaSize } = screen.getPrimaryDisplay()
|
|
@@ -685,6 +698,7 @@ function startLogin() {
|
|
|
685
698
|
ipcMain.on('auth-start', startLogin)
|
|
686
699
|
ipcMain.on('auth-code', async (_e, code) => {
|
|
687
700
|
const ok = () => {
|
|
701
|
+
addedFrom = null // the new account is real now: nothing to roll back to
|
|
688
702
|
if (win && !win.isDestroyed()) {
|
|
689
703
|
win.webContents.send('auth-state', { connected: true })
|
|
690
704
|
win.webContents.send('auth-result', { ok: true })
|
package/package.json
CHANGED
package/preload.js
CHANGED
|
@@ -18,6 +18,7 @@ contextBridge.exposeInMainWorld('api', {
|
|
|
18
18
|
onAccounts: (cb) => ipcRenderer.on('accounts', (_e, a) => cb(a)),
|
|
19
19
|
accountSwitch: (id) => ipcRenderer.send('accounts-switch', id),
|
|
20
20
|
accountAdd: () => ipcRenderer.send('accounts-add'),
|
|
21
|
+
accountCancelAdd: () => ipcRenderer.send('accounts-cancel-add'),
|
|
21
22
|
accountRemove: (id) => ipcRenderer.send('accounts-remove', id),
|
|
22
23
|
onDebugState: (cb) => ipcRenderer.on('debug-state', (_e, s) => cb(s)),
|
|
23
24
|
onVersion: (cb) => ipcRenderer.on('version', (_e, v) => cb(v)),
|
package/renderer/index.html
CHANGED
|
@@ -6,13 +6,18 @@
|
|
|
6
6
|
<title>Clauddy</title>
|
|
7
7
|
<link rel="stylesheet" href="style.css" />
|
|
8
8
|
</head>
|
|
9
|
-
<body class="state-idle">
|
|
9
|
+
<body class="state-idle one-account">
|
|
10
10
|
<div id="card">
|
|
11
|
-
<div id="account-chip" hidden>
|
|
11
|
+
<div id="account-chip" hidden title="Switch account">
|
|
12
12
|
<span class="ac-dot"></span>
|
|
13
13
|
<span id="ac-email"></span>
|
|
14
|
+
<svg class="ac-caret" viewBox="0 0 12 12" aria-hidden="true">
|
|
15
|
+
<path d="M3 5l3 3 3-3" />
|
|
16
|
+
</svg>
|
|
14
17
|
<span id="ac-plan" class="plan-badge" hidden></span>
|
|
15
18
|
</div>
|
|
19
|
+
<div id="acc-backdrop" hidden></div>
|
|
20
|
+
<div id="acc-menu" hidden></div>
|
|
16
21
|
<div id="controls">
|
|
17
22
|
<button id="gear" title="Settings">⚙</button>
|
|
18
23
|
<button id="usage" title="Open Usage page">
|
|
@@ -311,12 +316,6 @@
|
|
|
311
316
|
<span class="acc-ok" id="acc-ok">● Connected</span>
|
|
312
317
|
<button id="acc-logout" class="acc-link">Disconnect</button>
|
|
313
318
|
</div>
|
|
314
|
-
<!-- one row per subscription; only the active one is polled -->
|
|
315
|
-
<div id="acc-switch" hidden>
|
|
316
|
-
<div class="set-hint set-hint-left">Accounts</div>
|
|
317
|
-
<div id="acc-list"></div>
|
|
318
|
-
</div>
|
|
319
|
-
<button id="acc-add" class="acc-link">+ Add another account</button>
|
|
320
319
|
<div id="acc-disconnected">
|
|
321
320
|
<div class="set-hint set-hint-left" id="acc-intro">
|
|
322
321
|
Connect your Claude account to show your real usage.
|
package/renderer/pet.js
CHANGED
|
@@ -724,39 +724,56 @@ function setPlan(node, plan) {
|
|
|
724
724
|
window.api.onProfile(showProfile)
|
|
725
725
|
|
|
726
726
|
// ---- accounts ---------------------------------------------------------------
|
|
727
|
-
// The
|
|
728
|
-
//
|
|
727
|
+
// The account chip doubles as the switcher: click it for the list, with the
|
|
728
|
+
// active one marked. Settings only keeps the login flow itself.
|
|
729
729
|
let pendingRemove = null // id whose × is armed, so removal takes two clicks
|
|
730
730
|
let lastAccounts = null
|
|
731
|
+
let switching = false // a switch is in flight, so the menu waits for its answer
|
|
731
732
|
|
|
733
|
+
// one row of the chip dropdown
|
|
734
|
+
function accountRow(acc, a) {
|
|
735
|
+
const active = acc.id === a.active
|
|
736
|
+
const row = document.createElement('div')
|
|
737
|
+
row.className = 'acc-item'
|
|
738
|
+
if (active) row.classList.add('active')
|
|
739
|
+
if (acc.connected) row.classList.add('connected')
|
|
740
|
+
// the account being switched to owns the spinner: everything on screen
|
|
741
|
+
// still belongs to the one we're leaving
|
|
742
|
+
if (a.busy === acc.id) row.classList.add('loading')
|
|
743
|
+
|
|
744
|
+
const dot = document.createElement('span')
|
|
745
|
+
dot.className = 'dot'
|
|
746
|
+
const who = document.createElement('span')
|
|
747
|
+
who.className = 'who'
|
|
748
|
+
who.textContent =
|
|
749
|
+
acc.label || (acc.connected ? 'Connected' : active ? 'Waiting for login…' : 'Not connected')
|
|
750
|
+
row.append(dot, who)
|
|
751
|
+
return row
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// Everything about accounts lives in the chip dropdown: the chip already says
|
|
755
|
+
// which one you are on, so switching, adding and removing all happen there.
|
|
732
756
|
function renderAccounts(a) {
|
|
733
757
|
lastAccounts = a
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
758
|
+
document.body.classList.toggle('one-account', (a?.accounts || []).length < 2)
|
|
759
|
+
if (el('acc-menu').hidden) return
|
|
760
|
+
// the switch is done: the chip now names the account the menu was pointing at
|
|
761
|
+
if (switching && !a?.busy) closeAccountMenu()
|
|
762
|
+
else renderAccountMenu()
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function renderAccountMenu() {
|
|
766
|
+
const a = lastAccounts
|
|
767
|
+
const box = el('acc-menu')
|
|
737
768
|
box.textContent = ''
|
|
738
769
|
box.classList.toggle('busy', !!a?.busy)
|
|
739
|
-
for (const acc of
|
|
770
|
+
for (const acc of a?.accounts || []) {
|
|
740
771
|
const active = acc.id === a.active
|
|
741
|
-
const row =
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
// still belongs to the one we're leaving
|
|
747
|
-
if (a.busy === acc.id) row.classList.add('loading')
|
|
748
|
-
|
|
749
|
-
const dot = document.createElement('span')
|
|
750
|
-
dot.className = 'dot'
|
|
751
|
-
const who = document.createElement('span')
|
|
752
|
-
who.className = 'who'
|
|
753
|
-
who.textContent =
|
|
754
|
-
acc.label || (acc.connected ? 'Connected' : active ? 'Waiting for login…' : 'Not connected')
|
|
755
|
-
row.append(dot, who)
|
|
756
|
-
|
|
757
|
-
// the first account holds the original install's data, and the active one
|
|
758
|
-
// is what the widget is showing — neither can be removed from under you
|
|
759
|
-
if (acc.id !== 'default' && !active) {
|
|
772
|
+
const row = accountRow(acc, a)
|
|
773
|
+
|
|
774
|
+
// the active account is what the widget is showing: it can't be removed
|
|
775
|
+
// from under you, and the last one standing can't be removed at all
|
|
776
|
+
if (!active && (a.accounts || []).length > 1) {
|
|
760
777
|
const x = document.createElement('button')
|
|
761
778
|
const armed = pendingRemove === acc.id
|
|
762
779
|
x.className = armed ? 'drop armed' : 'drop'
|
|
@@ -769,24 +786,72 @@ function renderAccounts(a) {
|
|
|
769
786
|
window.api.accountRemove(acc.id)
|
|
770
787
|
} else {
|
|
771
788
|
pendingRemove = acc.id // a click deletes a token: ask once
|
|
772
|
-
|
|
789
|
+
renderAccountMenu()
|
|
773
790
|
}
|
|
774
791
|
})
|
|
775
792
|
row.appendChild(x)
|
|
776
793
|
}
|
|
777
794
|
|
|
778
|
-
|
|
795
|
+
// stopPropagation: re-rendering detaches this row, and the document-level
|
|
796
|
+
// "clicked outside" handler would then read that as a click off the menu
|
|
797
|
+
if (!active)
|
|
798
|
+
row.addEventListener('click', (e) => {
|
|
799
|
+
e.stopPropagation()
|
|
800
|
+
switchAccount(acc.id)
|
|
801
|
+
})
|
|
779
802
|
box.appendChild(row)
|
|
780
803
|
}
|
|
781
|
-
|
|
804
|
+
|
|
805
|
+
const add = document.createElement('div')
|
|
806
|
+
add.className = 'acc-item acc-add'
|
|
807
|
+
add.textContent = '+ Add another account'
|
|
808
|
+
add.addEventListener('click', () => {
|
|
809
|
+
closeAccountMenu()
|
|
810
|
+
el('acc-msg').textContent = ''
|
|
811
|
+
window.api.accountAdd() // switches to a fresh slot and opens the browser
|
|
812
|
+
})
|
|
813
|
+
box.appendChild(add)
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function closeAccountMenu() {
|
|
817
|
+
el('acc-menu').hidden = true
|
|
818
|
+
el('acc-backdrop').hidden = true
|
|
819
|
+
pendingRemove = null
|
|
820
|
+
switching = false
|
|
782
821
|
}
|
|
783
822
|
|
|
823
|
+
function toggleAccountMenu() {
|
|
824
|
+
const box = el('acc-menu')
|
|
825
|
+
if (!box.hidden) {
|
|
826
|
+
closeAccountMenu()
|
|
827
|
+
return
|
|
828
|
+
}
|
|
829
|
+
renderAccountMenu()
|
|
830
|
+
box.hidden = false
|
|
831
|
+
el('acc-backdrop').hidden = false
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
el('account-chip').addEventListener('click', (e) => {
|
|
835
|
+
e.stopPropagation()
|
|
836
|
+
toggleAccountMenu()
|
|
837
|
+
})
|
|
838
|
+
// clicking anywhere else — the pet, the gear, another app — puts it away
|
|
839
|
+
el('acc-backdrop').addEventListener('mousedown', closeAccountMenu)
|
|
840
|
+
document.addEventListener('click', (e) => {
|
|
841
|
+
if (!el('acc-menu').hidden && !el('acc-menu').contains(e.target)) closeAccountMenu()
|
|
842
|
+
})
|
|
843
|
+
window.addEventListener('blur', closeAccountMenu)
|
|
844
|
+
document.addEventListener('keydown', (e) => {
|
|
845
|
+
if (e.key === 'Escape') closeAccountMenu()
|
|
846
|
+
})
|
|
847
|
+
|
|
784
848
|
// paint the pending state from the click itself rather than waiting for main to
|
|
785
849
|
// answer — the answer is exactly what takes a moment
|
|
786
850
|
function switchAccount(id) {
|
|
787
851
|
if (lastAccounts?.busy) return
|
|
788
852
|
endLogin() // the code from the account we're leaving is no good here
|
|
789
853
|
pendingRemove = null
|
|
854
|
+
switching = true // the row stays on screen, pending, until main answers
|
|
790
855
|
renderAccounts({ ...lastAccounts, busy: id })
|
|
791
856
|
window.api.accountSwitch(id)
|
|
792
857
|
}
|
|
@@ -796,16 +861,20 @@ window.api.onAccounts((a) => {
|
|
|
796
861
|
renderAccounts(a)
|
|
797
862
|
})
|
|
798
863
|
|
|
864
|
+
// closing the panel while a login is pending gives up on it: main puts us back
|
|
865
|
+
// on the account we were using, and the half-made one goes away
|
|
866
|
+
function abandonLogin() {
|
|
867
|
+
if (!document.body.classList.contains('awaiting')) return
|
|
868
|
+
endLogin()
|
|
869
|
+
window.api.accountCancelAdd()
|
|
870
|
+
}
|
|
871
|
+
|
|
799
872
|
function endLogin() {
|
|
800
873
|
document.body.classList.remove('awaiting')
|
|
801
874
|
el('acc-paste').classList.remove('show')
|
|
802
875
|
el('acc-code').value = ''
|
|
803
876
|
el('acc-msg').textContent = ''
|
|
804
877
|
}
|
|
805
|
-
el('acc-add').addEventListener('click', () => {
|
|
806
|
-
el('acc-msg').textContent = ''
|
|
807
|
-
window.api.accountAdd() // switches to a fresh slot and opens the browser
|
|
808
|
-
})
|
|
809
878
|
let successTimer = null
|
|
810
879
|
window.api.onAuthResult((r) => {
|
|
811
880
|
if (r?.ok) {
|
|
@@ -884,14 +953,21 @@ el('acc-connect').addEventListener('click', () => window.api.authStart())
|
|
|
884
953
|
// main opened the browser — the only thing left to do is paste the code back,
|
|
885
954
|
// so the panel narrows to exactly that
|
|
886
955
|
window.api.onAuthPending(() => {
|
|
956
|
+
// the login can start from the account menu, with the panel closed: the code
|
|
957
|
+
// field is where the flow continues, so bring it up
|
|
958
|
+
openSettings()
|
|
887
959
|
document.body.classList.add('awaiting')
|
|
888
960
|
el('acc-paste').classList.add('show')
|
|
961
|
+
el('acc-code').classList.remove('filled')
|
|
889
962
|
el('acc-code').focus()
|
|
890
963
|
fitSize()
|
|
891
964
|
})
|
|
892
|
-
// the Connect button only lights up once there's a code to submit
|
|
965
|
+
// the Connect button only lights up once there's a code to submit, and the
|
|
966
|
+
// field stops asking for attention once it has one
|
|
893
967
|
el('acc-code').addEventListener('input', () => {
|
|
894
|
-
|
|
968
|
+
const code = el('acc-code').value.trim()
|
|
969
|
+
el('acc-confirm').classList.toggle('ready', !!code)
|
|
970
|
+
el('acc-code').classList.toggle('filled', !!code)
|
|
895
971
|
})
|
|
896
972
|
el('acc-confirm').addEventListener('click', () => {
|
|
897
973
|
const code = el('acc-code').value.trim()
|
|
@@ -1042,12 +1118,14 @@ for (const b of document.querySelectorAll('#set-mode .seg-btn')) {
|
|
|
1042
1118
|
})
|
|
1043
1119
|
}
|
|
1044
1120
|
el('set-cancel').addEventListener('click', () => {
|
|
1121
|
+
abandonLogin()
|
|
1045
1122
|
document.body.classList.remove('settings-open')
|
|
1046
1123
|
clearSaveDirty()
|
|
1047
1124
|
applyZoom(currentConfig?.zoom != null ? currentConfig.zoom : 100) // undo the preview
|
|
1048
1125
|
fitSize()
|
|
1049
1126
|
})
|
|
1050
1127
|
el('set-save').addEventListener('click', () => {
|
|
1128
|
+
abandonLogin() // leaving the panel gives up on a login waiting for its code
|
|
1051
1129
|
const num = (id) => parseFloat(el(id).value)
|
|
1052
1130
|
const fire = num('set-fire')
|
|
1053
1131
|
const zoomRaw = num('set-zoom')
|
|
@@ -1116,6 +1194,7 @@ if (typeof module === 'object' && module.exports) {
|
|
|
1116
1194
|
renderHeat,
|
|
1117
1195
|
showProfile,
|
|
1118
1196
|
renderAccounts,
|
|
1197
|
+
renderAccountMenu,
|
|
1119
1198
|
burn,
|
|
1120
1199
|
}
|
|
1121
1200
|
}
|
package/renderer/style.css
CHANGED
|
@@ -169,9 +169,10 @@ body.collapsed #usage {
|
|
|
169
169
|
z-index: 10;
|
|
170
170
|
display: flex;
|
|
171
171
|
align-items: center;
|
|
172
|
-
gap:
|
|
172
|
+
gap: 3px;
|
|
173
173
|
height: 19px; /* match #controls buttons so text centers on the same line */
|
|
174
|
-
|
|
174
|
+
/* #controls starts at ~154px: stop short of it, the pill has padding too */
|
|
175
|
+
max-width: 142px;
|
|
175
176
|
font-size: 9.5px;
|
|
176
177
|
line-height: 1;
|
|
177
178
|
color: var(--muted);
|
|
@@ -179,6 +180,106 @@ body.collapsed #usage {
|
|
|
179
180
|
#account-chip[hidden] {
|
|
180
181
|
display: none;
|
|
181
182
|
}
|
|
183
|
+
/* with something to switch to, the chip stops being a label and reads as a
|
|
184
|
+
control: a pill that holds the caret instead of leaving it floating */
|
|
185
|
+
#account-chip {
|
|
186
|
+
-webkit-app-region: no-drag;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
padding: 0 5px 0 6px;
|
|
189
|
+
margin-left: -6px; /* the text stays where it has always been */
|
|
190
|
+
border-radius: 10px;
|
|
191
|
+
background: rgba(255, 255, 255, 0.05);
|
|
192
|
+
transition:
|
|
193
|
+
background 0.15s,
|
|
194
|
+
color 0.15s;
|
|
195
|
+
}
|
|
196
|
+
#account-chip:hover {
|
|
197
|
+
background: rgba(255, 255, 255, 0.1);
|
|
198
|
+
color: var(--text);
|
|
199
|
+
}
|
|
200
|
+
/* a drawn chevron, not the ▾ glyph: the glyph's ink sits high in its em box, so
|
|
201
|
+
it never lines up with the dot and the text */
|
|
202
|
+
.ac-caret {
|
|
203
|
+
flex: none;
|
|
204
|
+
width: 9px;
|
|
205
|
+
height: 9px;
|
|
206
|
+
margin-left: -2px; /* hugs the email rather than drifting off it */
|
|
207
|
+
fill: none;
|
|
208
|
+
stroke: currentColor;
|
|
209
|
+
stroke-width: 1.6;
|
|
210
|
+
stroke-linecap: round;
|
|
211
|
+
stroke-linejoin: round;
|
|
212
|
+
}
|
|
213
|
+
/* a single account keeps the pill, minus the affordance: nothing to switch to.
|
|
214
|
+
The email then takes the width the chevron leaves behind. */
|
|
215
|
+
body.one-account #account-chip {
|
|
216
|
+
cursor: default;
|
|
217
|
+
}
|
|
218
|
+
body.one-account #account-chip:hover {
|
|
219
|
+
background: rgba(255, 255, 255, 0.05);
|
|
220
|
+
color: var(--muted);
|
|
221
|
+
}
|
|
222
|
+
body.one-account .ac-caret {
|
|
223
|
+
display: none;
|
|
224
|
+
}
|
|
225
|
+
/* the widget is mostly a drag region, and those swallow clicks before the page
|
|
226
|
+
ever sees them — so an invisible sheet under the menu catches them instead */
|
|
227
|
+
#acc-backdrop {
|
|
228
|
+
position: fixed;
|
|
229
|
+
inset: 0;
|
|
230
|
+
z-index: 19;
|
|
231
|
+
-webkit-app-region: no-drag;
|
|
232
|
+
}
|
|
233
|
+
#acc-backdrop[hidden] {
|
|
234
|
+
display: none;
|
|
235
|
+
}
|
|
236
|
+
/* dropdown under the chip; it overlays the pet rather than resizing the window */
|
|
237
|
+
#acc-menu {
|
|
238
|
+
position: absolute;
|
|
239
|
+
top: 24px;
|
|
240
|
+
left: 8px;
|
|
241
|
+
z-index: 20;
|
|
242
|
+
min-width: 118px;
|
|
243
|
+
max-width: 176px;
|
|
244
|
+
max-height: 120px;
|
|
245
|
+
overflow-y: auto;
|
|
246
|
+
padding: 3px;
|
|
247
|
+
border: 0.5px solid rgba(255, 210, 180, 0.1);
|
|
248
|
+
border-radius: 7px;
|
|
249
|
+
background: #221a15;
|
|
250
|
+
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
|
|
251
|
+
-webkit-app-region: no-drag;
|
|
252
|
+
}
|
|
253
|
+
#acc-menu[hidden] {
|
|
254
|
+
display: none;
|
|
255
|
+
}
|
|
256
|
+
#acc-menu.busy {
|
|
257
|
+
pointer-events: none; /* one switch at a time */
|
|
258
|
+
}
|
|
259
|
+
/* the add entry closes the list: it belongs to no account */
|
|
260
|
+
#acc-menu .acc-add {
|
|
261
|
+
margin-top: 2px;
|
|
262
|
+
padding-top: 6px;
|
|
263
|
+
border-top: 0.5px solid var(--hair);
|
|
264
|
+
border-radius: 0;
|
|
265
|
+
color: var(--coral-soft);
|
|
266
|
+
/* no .who inside this one, so it needs the row font itself */
|
|
267
|
+
font-size: 9.5px;
|
|
268
|
+
white-space: nowrap;
|
|
269
|
+
}
|
|
270
|
+
#acc-menu .acc-add:hover {
|
|
271
|
+
background: none;
|
|
272
|
+
color: var(--coral);
|
|
273
|
+
}
|
|
274
|
+
/* tighter than the dropdown-less list it replaced: it floats over the pet */
|
|
275
|
+
#acc-menu .acc-item {
|
|
276
|
+
gap: 6px;
|
|
277
|
+
padding: 4px 6px;
|
|
278
|
+
border-radius: 5px;
|
|
279
|
+
}
|
|
280
|
+
#acc-menu .acc-item .who {
|
|
281
|
+
font-size: 9.5px;
|
|
282
|
+
}
|
|
182
283
|
.ac-dot {
|
|
183
284
|
flex: none;
|
|
184
285
|
width: 6px;
|
|
@@ -187,6 +288,11 @@ body.collapsed #usage {
|
|
|
187
288
|
background: var(--pixel);
|
|
188
289
|
}
|
|
189
290
|
#ac-email {
|
|
291
|
+
/* line-height:1 leaves the ascender inside the box, so the text reads a hair
|
|
292
|
+
lower than the dot next to it — lift it back onto the same line */
|
|
293
|
+
transform: translateY(-1px);
|
|
294
|
+
flex: 1; /* claim the leftover width so the ellipsis is not left hanging */
|
|
295
|
+
min-width: 0;
|
|
190
296
|
overflow: hidden;
|
|
191
297
|
text-overflow: ellipsis;
|
|
192
298
|
white-space: nowrap;
|
|
@@ -683,20 +789,6 @@ body.live .live-only {
|
|
|
683
789
|
gap: 10px; /* the email ellipsizes instead of touching Disconnect */
|
|
684
790
|
flex-wrap: wrap; /* the success line drops to its own row */
|
|
685
791
|
}
|
|
686
|
-
#acc-switch {
|
|
687
|
-
margin-top: 10px;
|
|
688
|
-
}
|
|
689
|
-
#acc-switch[hidden] {
|
|
690
|
-
display: none;
|
|
691
|
-
}
|
|
692
|
-
#acc-list {
|
|
693
|
-
display: flex;
|
|
694
|
-
flex-direction: column;
|
|
695
|
-
margin-top: 2px;
|
|
696
|
-
}
|
|
697
|
-
#acc-list.busy {
|
|
698
|
-
pointer-events: none; /* one switch at a time */
|
|
699
|
-
}
|
|
700
792
|
/* a plain list, not a stack of cards: the panel already has enough boxes */
|
|
701
793
|
.acc-item {
|
|
702
794
|
display: flex;
|
|
@@ -762,11 +854,11 @@ body.live .live-only {
|
|
|
762
854
|
line-height: 1;
|
|
763
855
|
padding: 0 2px;
|
|
764
856
|
cursor: pointer;
|
|
765
|
-
opacity: 0; /*
|
|
857
|
+
opacity: 0.3; /* faint until hover: this deletes a token */
|
|
766
858
|
transition: opacity 0.15s;
|
|
767
859
|
}
|
|
768
860
|
.acc-item:hover .drop {
|
|
769
|
-
opacity: 0.
|
|
861
|
+
opacity: 0.75;
|
|
770
862
|
}
|
|
771
863
|
.acc-item .drop:hover {
|
|
772
864
|
opacity: 1;
|
|
@@ -779,13 +871,6 @@ body.live .live-only {
|
|
|
779
871
|
font-size: 10px;
|
|
780
872
|
color: var(--coral);
|
|
781
873
|
}
|
|
782
|
-
#acc-add {
|
|
783
|
-
margin-top: 6px;
|
|
784
|
-
}
|
|
785
|
-
/* while a login is pending, "add another" would start a second one */
|
|
786
|
-
body.awaiting #acc-add {
|
|
787
|
-
display: none;
|
|
788
|
-
}
|
|
789
874
|
#acc-paste {
|
|
790
875
|
display: none;
|
|
791
876
|
margin-top: 8px;
|
|
@@ -793,6 +878,20 @@ body.awaiting #acc-add {
|
|
|
793
878
|
#acc-paste.show {
|
|
794
879
|
display: block;
|
|
795
880
|
}
|
|
881
|
+
/* while the browser is open, this empty field is the whole flow: make it say so */
|
|
882
|
+
body.awaiting #acc-code:not(.filled) {
|
|
883
|
+
border-color: var(--coral);
|
|
884
|
+
animation: code-wait 1.6s ease-in-out infinite;
|
|
885
|
+
}
|
|
886
|
+
@keyframes code-wait {
|
|
887
|
+
0%,
|
|
888
|
+
100% {
|
|
889
|
+
box-shadow: 0 0 0 0 rgba(217, 119, 87, 0);
|
|
890
|
+
}
|
|
891
|
+
50% {
|
|
892
|
+
box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.22);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
796
895
|
#acc-code {
|
|
797
896
|
width: 100%;
|
|
798
897
|
margin: 4px 0 6px;
|