Skip to content

fix: support localized lens and billing pages - #187

Merged
Microck merged 1 commit into
mainfrom
fix/localized-account-pages
Sep 13, 2026
Merged

Microck merged 1 commit into
mainfrom
fix/localized-account-pages

Conversation

@Microck

@Microck Microck commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

localized Kagi accounts broke every lens command that needs the edit URL, and Starter plan accounts could not use kagi usage at all.

this reads lens edit links from their stable route, treats the plan-specific AI cost box as optional, and recognizes the Norwegian balance and renewal labels reported in the issues.

Closes #185.
Closes #186.

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets --locked (317 passed, 13 credential-gated tests ignored)
  • localized lens parser regression test
  • localized Starter usage parser regression test, including "ai_cost": null
  • pnpm build from docs/ (44 static pages)
  • (cd npm && npm pack --dry-run)

Docs

  • usage reference updated
  • changelog updated
  • README does not need a change

Auth / secrets

  • no tokens, cookies, or local config secrets committed
  • no live authenticated requests were made by the agent

AI assistance

Summary by CodeRabbit

  • Bug Fixes

    • Lens listing and related commands now recognize edit links across account languages.
    • kagi usage now supports plans without AI cost tracking.
    • Usage reports now correctly read balances and renewal dates from localized billing pages.
    • AI cost details are shown only when available.
  • Documentation

    • Updated kagi usage documentation to explain when AI cost fields appear in JSON responses.

@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 13, 2026 4:28pm UTC

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0006e957-f42f-46cb-ad9e-f20c66cf793b

📥 Commits

Reviewing files that changed from the base of the PR and between 92fc5e6 and f1e8451.

📒 Files selected for processing (1)
  • src/usage.rs

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes update lens parsing for localized markup and usage parsing for plans without AI cost tracking and Norwegian billing labels. Tests, command documentation, and the unreleased changelog reflect these behaviors.

Changes

Localized parsing fixes

Layer / File(s) Summary
Locale-independent lens edit links
src/parser.rs, tests/integration-cli.rs
Lens edit links are selected by the /settings/update_lens?id= route. Regression fixtures cover localized labels and markup without the former wrapper.
Optional and localized usage data
src/usage.rs, docs/content/docs/commands/usage.mdx, CHANGELOG.md
Usage parsing accepts English and Norwegian labels. ai_cost is optional, output omits the AI cost line when absent, and documentation and changelog entries describe the updated behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 35dea

Localized lens and billing parsing behavior is covered without an identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: support for localized lens and billing pages.
Description check ✅ Passed The description includes the required summary, verification, documentation, and auth/secrets sections. It explains the changes, motivation, tests, documentation updates, and secret-handling status.
Linked Issues check ✅ Passed The changes satisfy [#185] by locating lens edit links with the locale-independent /settings/update_lens?id= route. The changes satisfy [#186] by making UsageReport.ai_cost optional, accepting `Sa…
Out of Scope Changes check ✅ Passed The production changes, regression tests, documentation, and changelog entries directly support [#185] and [#186]. No unrelated production behavior or unrelated file changes are shown.
Docstring Coverage ✅ Passed Docstring coverage is 94.12% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 3 files.
Release Metadata Consistency ✅ Passed All required release metadata matches at the pull-request head: Cargo.toml, Cargo.lock's kagi package, and npm/package.json each specify 0.20.0. CHANGELOG.md contains exactly one matching ## [0.20.0] …
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/localized-account-pages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T16:29:45.143170Z 35dea27 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92fc5e680c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/usage.rs Outdated
Comment thread src/usage.rs Outdated
@Microck

Microck commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 GPT-5 responding on behalf of Microck

this warning treats the abbreviated HTML excerpt in #186 as the full page. the excerpt contains after <span>Starter</span>. the reporter's tested patch only makes ai_cost optional and adds the localized balance and renewal labels, and their human E2E output already contains "plan": "Starter".

the existing plan parser is therefore working against the full live page. adding a fallback for any standalone Starter span would guess from unrelated page text. the regression fixture intentionally covers only the parser behavior changed here.

@Microck
Microck force-pushed the fix/localized-account-pages branch from f1e8451 to 35dea27 Compare September 13, 2026 16:27
@Microck
Microck merged commit 6bec800 into main Sep 13, 2026
9 checks passed
@Microck
Microck deleted the fix/localized-account-pages branch September 13, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant