Skip to content

feat: sign in on another device, and read the table in one pass - #46

Merged
fylorn merged 1 commit into
devfrom
feat/upstream-table-and-chatgpt-dialog
Sep 18, 2026
Merged

fylorn merged 1 commit into
devfrom
feat/upstream-table-and-chatgpt-dialog

Conversation

@fylorn

@fylorn fylorn commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Pins core v0.7.0 (ThinkWatchProject/ThinkWatch-Core#42, #43) and builds the three things on top of it.

Sign in on another device

The login dialog asks where to authorise: 在这台电脑上登录 (unchanged) or 在其他设备上登录, which shows a one-time code and the page to type it on. The code stays in Rust exactly as the authorize URL does — the webview gets the code to display and a copy_chatgpt_code command, never an arbitrary clipboard write. Codex's caution is there too: only the code shown here, never one somebody sent you.

Signing in again on an existing account (from its edit dialog) keeps its name and egress and skips the notice it already accepted.

The table, in one pass

Eight columns became five. Protocol, address and egress are one line under the name; 24-hour requests and cost are one cell; subscription quota is a bar where per-token upstreams name what they bill by. An upstream that has never reported quota still says how it bills — an empty bar would claim it had used nothing.

The account dialog

A ChatGPT account has no address, protocol or credential to fill in, so its edit dialog is 账号 / 模型 / 安全. The quota windows and reset credits moved into it from the separate 额度与重置卡 dialog, which is where people were already looking for them; the row menu item now opens that tab.

Checked

Isolated preview (.claude/preview/upstreams.tsx, not committed) on the real components: table, account dialog, login dialog, the device-code screen and the re-login variant. pnpm typecheck, pnpm test (92), pnpm build, cargo fmt --check, cargo clippy -D warnings all pass.

🤖 Generated with Claude Code

Three things the upstreams page could not do.

**Sign in without this computer's browser.** The login dialog now asks
where to authorise: here, or with a code typed on a device that is already
signed in. The code, like the authorize URL before it, stays in Rust — the
webview is handed the code to display and a command to copy it, never a
clipboard it can write anything into. Signing in again on an existing
account reuses its name and egress and skips the notice it already
accepted.

**Read a row in one pass.** The table was eight columns wide and the
answer to "can I still use this one" was split across three of them.
Protocol, address and egress are one line under the name; requests and
cost are one cell; and subscription quota is a bar where per-token
upstreams say what they bill by. An upstream that has never reported quota
still says how it bills — an empty bar would claim it had used nothing.

**Edit an account for what it is.** A ChatGPT account has no address,
protocol or credential to fill in, so its dialog is 账号 / 模型 / 安全:
name and egress, the login and what it costs, the quota windows and the
reset credits — the last two moved here from a separate dialog, which is
where they were already being looked for.

Pins core v0.7.0, whose usage call now fills the in-memory quota, so the
bars are there on a cold start instead of after the first request.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 79156b3 into dev Sep 18, 2026
2 checks passed
@fylorn
fylorn deleted the feat/upstream-table-and-chatgpt-dialog branch September 18, 2026 16:17
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