fix(shell): correct /usage remaining quota colors#2039
fix(shell): correct /usage remaining quota colors#2039binichallein wants to merge 6 commits intoMoonshotAI:mainfrom
Conversation
| - Shell: Fix usage remaining quota colors | ||
|
|
There was a problem hiding this comment.
🟡 English changelog manually edited instead of auto-synced from root CHANGELOG.md
docs/en/release-notes/changelog.md is directly edited in this PR, but docs/AGENTS.md:185 explicitly states: "The English changelog (docs/en/release-notes/changelog.md) is auto-generated from the root CHANGELOG.md. Do not edit it manually." The authoring workflow at docs/AGENTS.md:27 also says: "For changelog: edit the root CHANGELOG.md, then run npm run sync to update the English docs." The correct workflow is to only edit the root CHANGELOG.md and let the sync script (docs/scripts/sync-changelog.mjs) generate the English docs version.
Prompt for agents
The file docs/en/release-notes/changelog.md should not be manually edited. According to docs/AGENTS.md (line 185 and line 27), the correct workflow is to edit only the root CHANGELOG.md and then run 'npm run sync' from the docs/ directory to auto-generate the English changelog. Remove the manual edits from docs/en/release-notes/changelog.md and rely on the sync script to propagate the changes from CHANGELOG.md.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
I initially resolved the changelog conflict manually, but I corrected the workflow afterward.
The current state follows the repo rules:
CHANGELOG.mdis the source of truthdocs/en/release-notes/changelog.mdwas regenerated vianode docs/scripts/sync-changelog.mjsdocs/zh/release-notes/changelog.mdwas merged accordingly as the translated page
Signed-off-by: binichallein <132759743+binichallein@users.noreply.github.com>
|
You misunderstood the problem and gave a wrong fix. |
|
Usually people gave 0 < used < 70%, green This is common practice and claude code also obeys.
https://code.claude.com/docs/en/statusline#display-multiple-lines |
|
@sunmy2019 Thanks for catching this. You were right that my initial fix misunderstood the metric. I've updated the PR so
That matches the usual used-quota thresholds after converting from remaining quota. I also added regression tests and resolved the changelog/docs conflicts following the repo workflow ( Latest update is in |
Related Issue
Resolve #2019
Description
This fixes the inverted quota colors in
/usage.Root cause:
_ratio_color()receives the remaining-quota ratio ((limit - used) / limit), not the used ratioChanges:
<= 10% lefttored<= 30% lefttoyellow> 30% lefttogreenThis is equivalent to the common used-quota thresholds:
< 70% used=> green70%-89% used=> yellow>= 90% used=> redChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.