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
@@ -23,10 +23,11 @@ YapCap lives in your COSMIC panel and shows how much of your AI coding quota you
23
23
24
24
## Highlights
25
25
26
-
-**Three providers**
26
+
-**Four providers**
27
27
-**Codex** — 5h/weekly windows + credits
28
28
-**Claude Code** — session/weekly/extra usage
29
29
-**Cursor** — plan usage + billing cycle end
30
+
-**Gemini** — Pro / Flash / Lite quota bars (OAuth accounts only)
30
31
-**Multi-account view** — add, switch, and remove accounts per provider. Turn on **Show all accounts** to lay out each selected account side by side in the popup and show one usage-bar group per account in the panel.
31
32
-**Active badge** — YapCap reads your local Codex and Claude Code session state to mark which account is currently active in the host CLI.
32
33
-**In-app login** — guided login flows for Codex, Claude, and Cursor without leaving YapCap or opening a terminal
Copy file name to clipboardExpand all lines: docs/qa.md
+73-10Lines changed: 73 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# YapCap QA Plan
2
2
3
-
Manual test plan for v0.4.0. Run against both Native (`just install`) and Flatpak (`just flatpak-install`) builds unless noted.
3
+
Manual test plan for v0.5.0. Run against both Native (`just install`) and Flatpak (`just flatpak-install`) builds unless noted.
4
4
5
5
Paths used below:
6
6
@@ -188,7 +188,70 @@ In Settings → General, cycle through all four panel icon styles and verify the
188
188
189
189
---
190
190
191
-
## 9. Multi-account
191
+
## 9. Gemini
192
+
193
+
### 9.1 Fresh install / Login required
194
+
195
+
- With no Gemini accounts configured, the Gemini provider tab is visible and shows the **Login required** empty state pointing to Settings → Gemini → Add account.
196
+
- Pre-existing host `~/.gemini/oauth_creds.json` is **not** imported. YapCap does not read host tokens.
197
+
198
+
### 9.2 Add account (Native and Flatpak)
199
+
200
+
- Settings → Gemini → Add account opens the system browser (Native: directly; Flatpak: via `org.freedesktop.portal.OpenURI`) at Google's sign-in page.
201
+
- The browser redirects back to a loopback `127.0.0.1:<port>/?code=…&state=…` callback served by YapCap; the success page reads "Signed in to Gemini — you can close this tab and return to YapCap."
202
+
- Cancel during login aborts cleanly with no partial account stored.
203
+
- Successful login stores the account under native `~/.local/state/yapcap/gemini-accounts/<id>/` or Flatpak `~/.var/app/io.github.TopiCsarno.YapCap/data/yapcap/gemini-accounts/<id>/`.
204
+
- Stored directory contains `metadata.json` (email, sub, optional `hd`, last tier id, last `cloudaicompanionProject`) and `tokens.json` (`access_token`, `refresh_token`, `expires_at`, `scope`).
205
+
- New account is selected immediately in single-account mode.
206
+
207
+
### 9.3 Multi-account dedupe
208
+
209
+
- Add a second Gemini account with a different Google identity — both accounts appear in Settings and the popup.
210
+
- Re-running Add account with an already-stored Google account updates the existing managed directory by normalized email; no second entry is created.
211
+
212
+
### 9.4 Usage display
213
+
214
+
- Free-tier account: popup shows two bars (**Flash**, **Lite**); the Pro bar is hidden.
215
+
- Standard-tier (AI Pro) account: popup shows three bars (**Pro**, **Flash**, **Lite**); panel bars show Pro + Flash.
- Each bucket reset follows the YapCap-wide `reset_time_format` preference.
218
+
219
+
### 9.5 Tier transitions
220
+
221
+
- Upgrade a free-tier account to AI Pro (or downgrade). On the next refresh cycle the Pro bar appears or disappears and the plan badge updates from **Free** to **Pro**/**Workspace** (or back), without restarting YapCap.
222
+
223
+
### 9.6 Active account hint
224
+
225
+
- With YapCap running, `gemini auth login` to a Gemini account YapCap is tracking — the **Active** badge follows the new active email written to `~/.gemini/google_accounts.json`.
226
+
- Switching to a Google account that YapCap does not track removes the Active badge from all tracked accounts.
227
+
- Deleting `~/.gemini/google_accounts.json` clears the Active badge; recreating it (e.g. via another `gemini auth login`) restores it without a YapCap restart.
228
+
- Flatpak: same behaviour through the read-only home mount; click **Refresh now** as a fallback if file watching misses an atomic replace.
229
+
230
+
### 9.7 Token refresh and re-auth
231
+
232
+
- Set `expires_at` to one minute in the past with a valid `refresh_token`. Verify silent refresh on the next cycle and updated `expires_at` in `tokens.json`.
233
+
- Replace `refresh_token` with junk. Verify `ActionRequired` badge ("Login") on the account, plus a per-account re-auth icon in Settings.
234
+
- Per-account re-auth: click re-auth icon → complete OAuth in the browser with the same Google account → usage refreshes immediately.
235
+
- Per-account re-auth with a different Google account (different `id_token.email`) → rejected with error, existing account left unchanged.
236
+
237
+
### 9.8 Remove account
238
+
239
+
- Remove from Settings — only the YapCap-owned account directory is deleted. Host `~/.gemini/` files (`oauth_creds.json`, `google_accounts.json`, `settings.json`) are not touched.
240
+
- If it was the last Gemini account, the provider returns to the Login required empty state.
241
+
242
+
### 9.9 Host CLI configurations that don't interfere
243
+
244
+
- Pre-existing `~/.gemini/settings.json` with `selectedAuthType: gemini-api-key` or `vertex-ai`: YapCap still runs OAuth login and stores its own tokens; the absence of an Active badge for these accounts is **expected**, not a bug.
245
+
- A `GEMINI_API_KEY` environment variable on the host shell has no effect on YapCap.
246
+
247
+
### 9.10 `cloudresourcemanager` fallback
248
+
249
+
- For accounts where `loadCodeAssist` returns no `cloudaicompanionProject` (common when the user has a paid GCP project but no auto-assigned Code Assist project), YapCap calls `cloudresourcemanager.googleapis.com/v1/projects` and picks the first `ACTIVE` project whose id begins with `gen-lang-client-`. Verify the discovered project id is persisted to `metadata.json` (`gemini_last_cloudaicompanion_project`) and the next refresh re-uses it directly.
250
+
- For accounts where neither path yields a project, the provider surfaces the actionable `NoCloudaicompanionProject` error in the popup.
251
+
252
+
---
253
+
254
+
## 10. Multi-account
192
255
193
256
- Add a second account for any provider.
194
257
-`Show all accounts` toggle appears only when the provider has more than one account.
@@ -200,7 +263,7 @@ In Settings → General, cycle through all four panel icon styles and verify the
200
263
201
264
---
202
265
203
-
## 10. Stale / error states
266
+
## 11. Stale / error states
204
267
205
268
- Kill network (`nmcli networking off`). Trigger a refresh. Verify "No internet connection. Showing cached data; information is not up to date." message. Cached usage data still visible. Re-enable network, verify Live badge returns.
206
269
- Wait 11 minutes without refreshing (or set refresh interval to max and advance clock). Verify account badge switches from Live to Stale. Status line appends "(stale)".
@@ -209,7 +272,7 @@ In Settings → General, cycle through all four panel icon styles and verify the
209
272
210
273
---
211
274
212
-
## 11. Provider enable/disable
275
+
## 12. Provider enable/disable
213
276
214
277
- Disable a provider via its settings toggle — provider tab disappears from popup nav.
215
278
- All provider-specific settings below the toggle are dimmed and non-interactive when disabled.
@@ -218,7 +281,7 @@ In Settings → General, cycle through all four panel icon styles and verify the
218
281
219
282
---
220
283
221
-
## 12. Popup sizing
284
+
## 13. Popup sizing
222
285
223
286
- Single-account provider: popup is 420 px wide.
224
287
- Two-account provider: popup is 840 px wide.
@@ -229,13 +292,13 @@ In Settings → General, cycle through all four panel icon styles and verify the
229
292
230
293
---
231
294
232
-
## 13. Accounts removed from filesystem
295
+
## 14. Accounts removed from filesystem
233
296
234
297
- Manually delete a provider account directory from the YapCap data tree (`~/.local/state/yapcap/<provider>-accounts/` native, or `~/.var/app/io.github.TopiCsarno.YapCap/data/yapcap/<provider>-accounts/` Flatpak). Trigger a refresh. Verify the provider surfaces "Login required" or empty state rather than showing a stale snapshot indefinitely.
235
298
236
299
---
237
300
238
-
## 14. Config state file manipulation
301
+
## 15. Config state file manipulation
239
302
240
303
- Delete cached snapshots (native `~/.cache/yapcap/snapshots.json`, Flatpak `~/.var/app/io.github.TopiCsarno.YapCap/cache/yapcap/snapshots.json`). Restart. Verify app starts with Loading state and fetches fresh data.
241
304
- Delete the COSMIC config dir (`just clear-config`). Restart. Verify defaults apply: all providers enabled, refresh interval 300s, relative reset time, used amount format.
@@ -245,19 +308,19 @@ In Settings → General, cycle through all four panel icon styles and verify the
245
308
246
309
---
247
310
248
-
## 15. Logging
311
+
## 16. Logging
249
312
250
313
- Native: verify `~/.local/state/yapcap/logs/yapcap.log`. Flatpak: verify `~/.var/app/io.github.TopiCsarno.YapCap/data/yapcap/logs/yapcap.log`. Each is written during a normal session for that build.
251
314
- Verify no bearer tokens, access tokens, cookie values, or refresh tokens appear in the log.
252
315
-`RUST_LOG=debug just run` — debug output in terminal, still no credentials in log file.
253
316
254
317
---
255
318
256
-
## 16. Flatpak-specific
319
+
## 17. Flatpak-specific
257
320
258
321
- Install via `just flatpak-install`. YapCap appears in COSMIC applet list.
259
322
- Install from the COSMIC Store. YapCap appears in the COSMIC panel applet picker after installation, uses the `io.github.TopiCsarno.YapCap` Flatpak id, appears under the applet category/filter, and shows "Place on desktop" rather than "Open".
260
-
- COSMIC Store details page shows developer `Tamás Csarnó`, version `0.4.0`, description paragraphs without manual line-break wrapping, and screenshots in this order: detail popup, Codex zoom, Claude Code zoom, Cursor zoom, Settings.
323
+
- COSMIC Store details page shows developer `Tamás Csarnó`, version `0.5.0`, description paragraphs without manual line-break wrapping, and screenshots in this order: detail popup, Codex zoom, Claude Code zoom, Cursor zoom, Settings.
261
324
- About section shows "Flatpak" dist label.
262
325
- OAuth flows (Codex, Claude) open the system browser correctly from inside the sandbox.
263
326
- COSMIC dark/light theme and accent colour updates are observed immediately through the settings config watcher.
0 commit comments