Skip to content

fix: /quota command ignores percentDisplayMode config #116

@XDayonline

Description

@XDayonline

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

  1. Set percentDisplayMode: "used" in config
  2. Run /quota -> shows XX% left (wrong)
  3. 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

  1. Import formatDisplayedPercentLabel in quota-command-format.js
  2. Replace hardcoded % left with formatDisplayedPercentLabel(row.percentRemaining, params.percentDisplayMode)
  3. Pass percentDisplayMode: runtime.config.percentDisplayMode in plugin.js handleQuotaSlashCommand

Happy to open a PR if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions