fix: refractor card art post-merge fixes — cache bypass, template guards, dev server #180
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#180
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/refractor-card-art-followup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
?tier=param is set to prevent serving stale T0 images for tier preview{% if %}guard beforediamond_colorsdict definition in player_card.html#fullCardstyles outside refractor conditional in tier_style.html, remove redundant T0 else blockPOSTGRES_HOST_LOCAL, clean up Playwright existence checkFollow-up to PR #179.
Test plan
?tier=param returns fresh rendered PNG, not cached T0- Skip PNG cache when ?tier= param is set to prevent serving stale T0 images - Move {% if %} guard before diamond_colors dict in player_card.html - Extract base #fullCard styles outside refractor conditional in tier_style.html - Make run-local.sh DB host configurable, clean up Playwright check Follow-up to PR #179 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>APPROVED — all four fix areas are correct. Two minor notes.
1. Cache bypass (
players.py) ✅and tier is Nonecorrectly prevents a stale PNG (likely T0) from being served when a caller explicitly passes?tier=. The condition short-circuits theos.path.existscheck so rendering always runs when a tier is requested.Minor:
tier=0also bypasses the cache, which means a cached T0 card won’t be served even whentier=0is explicitly passed. Since T0 and the cached default are identical, the caller just pays an extra render — harmless, but worth knowing. If T0 should use the cache, the condition could beand (tier is None or tier == 0). Not blocking.2. Template guard placement (
player_card.html) ✅Moving
diamond_colorsinside{% if refractor_tier is defined and refractor_tier > 0 %}is correct. The old order (dict outside,dc = diamond_colors[refractor_tier]inside) was technically safe becausedcis only accessed whenrefractor_tier > 0— but it was confusing. Having the dict and its consumer co-located inside the same guard is cleaner and semantically correct. No functional change for T1–T4.3. CSS restructuring (
tier_style.html) ✅Extracting
#fullCard { position: relative; overflow: hidden; }to an unconditional<style>block is the right call — it was duplicated identically in both the if and else branches. The new structure (base styles always emitted, tier-specific styles conditionally appended) is clean and DRY.Minor to verify:
#resultHeader.border-bot { border-bottom-width: 4px; }is removed from the conditional block (around the original line 68 context). This isn’t called out in the PR description — if it’s dead CSS from thed92ab86visual tuning commit, the removal is correct. Just confirm it isn’t relied on by any live template path.File still lacks a trailing newline (same as PR #179). Cosmetic only.
4.
run-local.sh✅Both changes are improvements:
Playwright check:
print(p.chromium.executable_path)is a faster, lighter check than launching a browser instance. It raises the same exception if Chromium isn’t installed, so the|| exit 1path still fires correctly. The>/dev/null 2>&1redirect properly silences the path output.DB host: Setting
DB_HOST="${POSTGRES_HOST_LOCAL:-10.10.0.42}"once and reusing it in both the connectivity check (sys.argv[1]) and theexport POSTGRES_HOSTline eliminates the previous duplication where the env-var expansion was written out twice. Passing the host viasys.argv[1]rather than shell-interpolating it into the Python string is the cleaner pattern.Approved via pd-pr
Approved via pd-pr