Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/TierTemplateSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const TierTemplateSelector: React.FC = () => {
<DropdownMenuRadioItem value="3rows">3 Rows</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="5rows">5 Rows</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="7rows">7 Rows</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="9rows">9 Rows</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
Comment on lines 54 to 58
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new 9-row template option isn’t covered by the existing Playwright regression tests. Consider adding a UI test that selects "9 Rows" and asserts the tier list renders 9 ranked rows + uncategorized (and/or updates the snapshot) to prevent regressions in the selector wiring and template application.

Copilot uses AI. Check for mistakes.
<DropdownMenuSeparator/>
<DropdownMenuLabel>Label Position</DropdownMenuLabel>
Expand Down
2 changes: 2 additions & 0 deletions lib/TierCortex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const OG_TIER_GRADIENTS = [
'linear-gradient(to right, #7ad21f, #1aea1d)',
'linear-gradient(to right, #72b231, #0cd30e)',
'linear-gradient(to right, #4d7e15, #01b004)',
'linear-gradient(to right, #578d21, #2dbf08)',
'linear-gradient(to right, #6f9f45, #42c834)',
];

export class TierCortex {
Expand Down
2 changes: 2 additions & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const getTierGradient = (index: number, tiersLength: number): string => {
return `var(--tier-gradient-${[0, 2, 4][index % 3]})`;
case 6:
return `var(--tier-gradient-${[0, 1, 3, 4, 6][index % 5]})`;
case 10:
return `var(--tier-gradient-${[0, 1, 2, 2, 3, 4, 5, 5, 6][index % 9]})`;
Comment on lines +28 to +29
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Editor and OG palettes diverge for 9-row templates.

Lines 28-29 still map 10-tier layouts onto gradient slots 0..6, but lib/TierCortex.ts Lines 41-50 now add slots 7 and 8 for OG rendering. That means the live tier list and the generated/shared image will not use the same palette for 9 rows.

Please drive both getTierGradient() and getOgTierGradient() from the same shared index map/palette so the editor and exported output stay visually identical.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/utils.ts` around lines 28 - 29, The editor and OG functions diverge
because getTierGradient() uses an inline index map while getOgTierGradient()
uses a different map; fix by extracting the shared index-to-gradient-slot map
into a single exported constant or helper (e.g., TIER_INDEX_MAP or
mapIndexToSlot) and have both getTierGradient() and getOgTierGradient()
reference that shared map to compute the slot (use index % map.length) so both
functions produce identical palette selections for 9-row (and other) templates.

default:
return `var(--tier-gradient-${tierGradientIndexMap[index % 7]})`;
}
Expand Down
12 changes: 12 additions & 0 deletions models/Tier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ export const tierTemplates: TierTemplate = {
{id: 'tier-f', name: 'F', items: [], labelPosition: 'left', placeholder: 'F'},
{id: 'uncategorized', name: '', items: [], labelPosition: 'left'},
],
'9rows': [
{id: 'tier-sss', name: 'SSS', items: [], labelPosition: 'left', placeholder: 'SSS'},
{id: 'tier-ss', name: 'SS', items: [], labelPosition: 'left', placeholder: 'SS'},
{id: 'tier-s', name: 'S', items: [], labelPosition: 'left', placeholder: 'S'},
{id: 'tier-a', name: 'A', items: [], labelPosition: 'left', placeholder: 'A'},
{id: 'tier-b', name: 'B', items: [], labelPosition: 'left', placeholder: 'B'},
{id: 'tier-c', name: 'C', items: [], labelPosition: 'left', placeholder: 'C'},
{id: 'tier-d', name: 'D', items: [], labelPosition: 'left', placeholder: 'D'},
{id: 'tier-e', name: 'E', items: [], labelPosition: 'left', placeholder: 'E'},
{id: 'tier-f', name: 'F', items: [], labelPosition: 'left', placeholder: 'F'},
{id: 'uncategorized', name: '', items: [], labelPosition: 'left'},
],
};

export const DEFAULT_TIER_TEMPLATE = tierTemplates['5rows'];
Loading
Loading