fix: /quota command ignores percentDisplayMode config
Bug
The /quota slash command hardcodes % left regardless of the percentDisplayMode config setting.
The sidebar and compact status correctly use formatDisplayedPercentLabel() which respects percentDisplayMode, but /quota does not.
Reproduction
- Set
percentDisplayMode: "used"in config - Run
/quota-> showsXX% left(wrong) - Sidebar shows
XX% used(correct)
Root cause
quota-command-format.js:60 hardcodes:
lines.push(` ${labelCol} ${bar(pct, barWidth)} ${pct}% left${suffix}`);
Should use formatDisplayedPercentLabel(row.percentRemaining, params.percentDisplayMode) instead, and pass percentDisplayMode from runtime.config through handleQuotaSlashCommand.
Fix
- Import
formatDisplayedPercentLabelinquota-command-format.js - Replace hardcoded
% leftwithformatDisplayedPercentLabel(row.percentRemaining, params.percentDisplayMode) - Pass
percentDisplayMode: runtime.config.percentDisplayModeinplugin.jshandleQuotaSlashCommand
Happy to open a PR if helpful.
Thanks for opening this issue.
This issue was automatically closed because it does not match the expected issue template format.
Missing required template sections:
- A recognized Bug report or Feature request issue template
Please re-open using the Bug report or Feature request issue template.
You can open a new issue here: https://github.com/slkiser/opencode-quota/issues/new/choose
Closing as duplicate of #118 (same issue with correct template).