fix: clean up refractor status — suffix tags, compact layout #133

Merged
cal merged 1 commits from fix/refractor-status-cleanup into main 2026-03-26 06:00:33 +00:00
Owner

Summary

  • Tier as suffix tag: **Name** — Base Chrome [T1] (T0 cards show name only)
  • Compact progress: ▰▰▰▰▱▱▱▱▱▱▱▱ 53/149 (36%) — removed formula label and tier arrow
  • Fully evolved shows MAX in code block instead of FULLY EVOLVED
  • Deleted dead FORMULA_LABELS, added _FULL_BAR constant, removed unnecessary comments
  • Fixed mock API shape in test (cardsitems)

Test plan

  • All 101 refractor tests pass
## Summary - Tier as suffix tag: `**Name** — Base Chrome [T1]` (T0 cards show name only) - Compact progress: `▰▰▰▰▱▱▱▱▱▱▱▱ 53/149 (36%)` — removed formula label and tier arrow - Fully evolved shows `MAX` in code block instead of FULLY EVOLVED - Deleted dead `FORMULA_LABELS`, added `_FULL_BAR` constant, removed unnecessary comments - Fixed mock API shape in test (`cards` → `items`) ## Test plan - [x] All 101 refractor tests pass
cal added 1 commit 2026-03-26 05:22:48 +00:00
fix: clean up refractor status display — suffix tags, compact layout, dead code removal
All checks were successful
Ruff Lint / lint (pull_request) Successful in 20s
bbad1daba2
- Tier labels as suffix tags: **Name** — Base Chrome [T1] (T0 gets no suffix)
- Compact progress line: bar value/threshold (pct) — removed formula and tier arrow
- Fully evolved shows `MAX` instead of FULLY EVOLVED
- Deleted unused FORMULA_LABELS dict
- Added _FULL_BAR constant, moved T0-branch lookups into else
- Fixed mock API shape in test (cards → items)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude added the
ai-reviewing
label 2026-03-26 05:45:46 +00:00
Claude approved these changes 2026-03-26 05:48:35 +00:00
Dismissed
Claude left a comment
Collaborator

AI Code Review

Files Reviewed

  • cogs/refractor.py (modified)
  • tests/test_refractor_commands.py (modified)

Findings

Correctness

  • _FULL_BAR = "▰" * 12 is mathematically identical to the removed render_progress_bar(1, 1) call — no behavior change.
  • build_tier_summary change from TIER_SYMBOLS[t] or "Base" to TIER_SYMBOLS[t] is correct: the or "Base" fallback was only needed because T0 was "". Now T0 is "Base", the fallback is dead code. Safe removal.
  • format_refractor_entry T0 branch (first_line = f"**{player_name}**") is an exact match for the documented spec.
  • Mock fix in test_refractor_status_empty_roster ({"cards": []}{"items": [], "count": 0}) correctly aligns with the API response shape consumed by the command handler at line 382.
  • test_percentage_in_output allows both (80%) and (81%) — appropriate since 120/149 = 80.54% rounds to 81% with :.0% format. No issue.

Security

  • No security concerns. Changes are pure display logic with no user input in queries or commands.

Style & Conventions

  • All test method and class renames are consistent with the new behavior they cover.
  • _FULL_BAR underscore prefix correctly signals module-private, consistent with Python convention.
  • Removed comments in build_status_embed were obvious (e.g. # Card entries above a list comprehension). Clean removal.
  • track/card_type extraction removed from format_refractor_entry since FORMULA_LABELS no longer exists. No dead variable left behind.

Suggestions

  • No blocking suggestions.

Verdict: APPROVED

Clean, focused cleanup. All behavior changes match the PR description, every stale test is correctly removed or updated, and no regressions are introduced in the untouched tests. The _FULL_BAR constant is a nice micro-optimization that also improves readability.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `cogs/refractor.py` (modified) - `tests/test_refractor_commands.py` (modified) ### Findings #### Correctness - `_FULL_BAR = "▰" * 12` is mathematically identical to the removed `render_progress_bar(1, 1)` call — no behavior change. - `build_tier_summary` change from `TIER_SYMBOLS[t] or "Base"` to `TIER_SYMBOLS[t]` is correct: the `or "Base"` fallback was only needed because T0 was `""`. Now T0 is `"Base"`, the fallback is dead code. Safe removal. - `format_refractor_entry` T0 branch (`first_line = f"**{player_name}**"`) is an exact match for the documented spec. - Mock fix in `test_refractor_status_empty_roster` (`{"cards": []}` → `{"items": [], "count": 0}`) correctly aligns with the API response shape consumed by the command handler at line 382. - `test_percentage_in_output` allows both `(80%)` and `(81%)` — appropriate since `120/149 = 80.54%` rounds to `81%` with `:.0%` format. No issue. #### Security - No security concerns. Changes are pure display logic with no user input in queries or commands. #### Style & Conventions - All test method and class renames are consistent with the new behavior they cover. - `_FULL_BAR` underscore prefix correctly signals module-private, consistent with Python convention. - Removed comments in `build_status_embed` were obvious (e.g. `# Card entries` above a list comprehension). Clean removal. - `track`/`card_type` extraction removed from `format_refractor_entry` since `FORMULA_LABELS` no longer exists. No dead variable left behind. #### Suggestions - No blocking suggestions. ### Verdict: APPROVED Clean, focused cleanup. All behavior changes match the PR description, every stale test is correctly removed or updated, and no regressions are introduced in the untouched tests. The `_FULL_BAR` constant is a nice micro-optimization that also improves readability. --- *Automated review by Claude PR Reviewer*
Claude added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-26 05:49:22 +00:00
Claude approved these changes 2026-03-26 06:00:27 +00:00
Claude left a comment
Collaborator

LGTM — dead code removed, display simplified, tests updated.

LGTM — dead code removed, display simplified, tests updated.
cal merged commit f843b45099 into main 2026-03-26 06:00:33 +00:00
cal deleted branch fix/refractor-status-cleanup 2026-03-26 06:00:34 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#133
No description provided.