Commit f4b7221
feat(festivals): add stage order and color (#18)
* wip
* feat: add stage ordering and color coding system
- Add stage_order column and color column to stages table
- Update stage queries to order by stage_order then by name
- Implement stage color coding in timeline components
- Update timeline calculations to use stage ordering
- Apply stage colors to labels and timeline tracks
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat(admin): add stage order and color management UI
- Add stage_order and color fields to create/update mutations
- Extend StageManagement component with order and color controls
- Add number input for stage ordering with minimum value of 0
- Add color picker with hex input for stage colors
- Display order and color columns in admin stage table
- Show color preview swatches in table rows
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix(stages): prioritize explicitly ordered stages over default order
- Stages with order > 0 now appear first, sorted by their order value
- Stages with order 0 (default/unordered) appear last, sorted alphabetically
- This ensures main stages and other explicitly ordered stages are prioritized
- Updated sorting logic across all timeline and schedule components
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat: create reusable StageBadge component with color backgrounds
- Add StageBadge component with stage color as background
- Use stage color with 80% opacity for subtle but visible background
- Apply StageBadge to list view cards (MobileSetCard)
- Apply StageBadge to voting view (SetMetadata in ArtistsTab)
- Remove redundant colored dot since background now uses stage color
- Make badge text white with font-medium for better contrast
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* refactor: extract shared stage sorting logic into utility functions
- Create stageUtils.ts with reusable sorting functions
- Add sortStagesByOrder for generic item sorting based on stage data
- Add sortStages for direct stage array sorting
- Replace duplicated sorting logic in useStagesByEdition
- Replace duplicated sorting logic in useScheduleData
- Replace duplicated sorting logic in timelineCalculator (both horizontal and vertical)
- Maintain consistent stage ordering: priority stages (order > 0) first, then default stages (order 0) alphabetically
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* refactor(stages): sort
* refactor(timeline): remove vertical timeline calc
* refactor(admin): break stage management components
* fix(stages): update stage
* fix(infra): remove caching for supabase
* refactor(stages): move components
* refactor(stages): move default color to constants
---------
Co-authored-by: Claude <[email protected]>1 parent 195005f commit f4b7221
File tree
24 files changed
+661
-361
lines changed- src
- components
- hooks
- queries/stages
- integrations/supabase
- lib
- constants
- pages
- EditionView/tabs
- ArtistsTab/SetCard
- ScheduleTab
- horizontal
- list
- admin/festivals
- StageManagement
- supabase/migrations
24 files changed
+661
-361
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | | - | |
31 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
141 | | - | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| 643 | + | |
643 | 644 | | |
644 | 645 | | |
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| 649 | + | |
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
651 | 653 | | |
| 654 | + | |
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
655 | 658 | | |
656 | 659 | | |
| 660 | + | |
657 | 661 | | |
658 | 662 | | |
659 | 663 | | |
660 | 664 | | |
| 665 | + | |
661 | 666 | | |
662 | 667 | | |
663 | 668 | | |
664 | 669 | | |
665 | 670 | | |
| 671 | + | |
666 | 672 | | |
667 | 673 | | |
668 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments