Skip to content

Add "Used / Left" display framing toggle + Claude Desktop cookie scrape#36

Merged
BlockedPath merged 3 commits into
mainfrom
feat/ios-used-left-toggle
May 22, 2026
Merged

Add "Used / Left" display framing toggle + Claude Desktop cookie scrape#36
BlockedPath merged 3 commits into
mainfrom
feat/ios-used-left-toggle

Conversation

@BlockedPath

@BlockedPath BlockedPath commented May 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a Used / Left toggle in Settings so users can choose whether the meter displays usage consumed (e.g. "28% used") or remaining (e.g. "72% left"), matching the framing from the previous session's work
  • iOS widget updated to show % used consistent with the main app and claude.ai
  • Tightens the background refresh interval to ~40s so the display stays current
  • Restores scripts/claude-plan-usage-desktop.py — reads Claude Desktop's Keychain-encrypted Chromium cookies so the scrape basically never goes stale (no manual re-login needed like Firefox). Script was added in f7f4a88 on fix/claude-permanent-firefox but was never merged; the LaunchAgent plist already pointed to it, causing silent scrape failures when on other branches
  • iOS project cleanup: removes UIRequiresFullScreen (enables slide-over/split view), drops processing background mode, strips hardcoded DEVELOPMENT_TEAM in favor of local credentials

Test plan

  • Toggle "Used / Left" in Settings and confirm meter label flips on both the main view and the widget
  • Confirm curl http://localhost:9596/health shows ok: true and plan_usage.fresh: true after a scrape cycle
  • Verify no Keychain prompt appears on subsequent LaunchAgent runs after clicking "Always Allow" once
  • Build and run on device; confirm slide-over / Split View works (was blocked by UIRequiresFullScreen)

🤖 Generated with Claude Code

BlockedPath and others added 2 commits May 22, 2026 13:54
Script was installed in the LaunchAgent plist but never merged to main,
so it went missing after switching branches. Cherry-picked from f7f4a88.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… team ID

Xcode cleanup: drop UIRequiresFullScreen (allows slide-over/split view),
remove the processing background mode no longer needed, strip hardcoded
DEVELOPMENT_TEAM so signing is driven by local credentials.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@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: 8b11add796

ℹ️ 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 on lines +38 to +39
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Declare Crypto dependency for desktop scrape script

This new script imports Crypto at module load, but the project install path (pip install -r requirements.txt, used by install.sh) does not add a package that provides that module. On a normal fresh setup, invoking this script exits immediately with ModuleNotFoundError: No module named 'Crypto', so the new Claude Desktop scrape path cannot run at all.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in a45543d — added pycryptodome>=3.0 to requirements.txt.

Comment thread scripts/claude-plan-usage-desktop.py Outdated
f"claude-desktop scrape failed; falling back to {fallback.name}",
file=sys.stderr,
)
proc = subprocess.run([sys.executable, str(fallback)], check=False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Forward command to Firefox fallback

The fallback call always runs the Firefox script with no arguments, which defaults to scrape. If a user runs claude-plan-usage-desktop.py print and the desktop path fails (for example missing keychain access), the fallback unexpectedly performs a write instead of remaining print-only, violating this command's documented no-write behavior and potentially overwriting cached usage data during diagnostics.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in a45543dtry_fallback() now accepts and forwards the command arg, so print stays read-only through the fallback path.

…llback

- requirements.txt: add pycryptodome>=3.0 so fresh installs can import Crypto
- try_fallback(): accept and forward the command arg so `print` mode stays
  read-only even when falling through to the Firefox script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpycryptodome@​3.23.09810010010080

View full report

@BlockedPath BlockedPath merged commit bac39da into main May 22, 2026
4 checks passed
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