Skip to content

fix: respect percentDisplayMode in /quota command#117

Open
XDayonline wants to merge 1 commit into
slkiser:mainfrom
XDayonline:fix/percent-display-mode-quota-command
Open

fix: respect percentDisplayMode in /quota command#117
XDayonline wants to merge 1 commit into
slkiser:mainfrom
XDayonline:fix/percent-display-mode-quota-command

Conversation

@XDayonline
Copy link
Copy Markdown

Summary

The /quota slash command hardcodes % left regardless of the percentDisplayMode config setting. This makes it inconsistent with the sidebar and compact status, which correctly respect the setting.

Problem

  1. Set percentDisplayMode: "used" in config
  2. Sidebar shows XX% used (correct)
  3. /quota shows XX% left (wrong — ignores config)

Root Cause

src/lib/quota-command-format.ts:75 hardcodes:

lines.push(`  ${labelCol} ${bar(pct, barWidth)}  ${pct}% left${suffix}`);

While sidebar/compact use formatDisplayedPercentLabel() which respects percentDisplayMode.

Fix

  • Import formatDisplayedPercentLabel in quota-command-format.ts
  • Replace hardcoded % left with formatDisplayedPercentLabel(row.percentRemaining, params.percentDisplayMode)
  • Pass percentDisplayMode from runtime.config through handleQuotaSlashCommand
  • Update test to verify new behavior

Testing

  • All 26 tests in tests/plugin.quota-command.test.ts pass
  • TypeScript typecheck passes

Closes #116

The /quota command hardcoded '% left' regardless of the percentDisplayMode
config setting. Now uses formatDisplayedPercentLabel() to respect the
configured mode, matching sidebar and compact status behavior.

Fixes slkiser#116
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.

fix: /quota command ignores percentDisplayMode config

1 participant