refactor: Consolidate duplicate queue category display constants between repos.ts and queue.ts#209
Open
frostyardyeti[bot] wants to merge 1 commit intomainfrom
Open
refactor: Consolidate duplicate queue category display constants between repos.ts and queue.ts#209frostyardyeti[bot] wants to merge 1 commit intomainfrom
frostyardyeti[bot] wants to merge 1 commit intomainfrom
Conversation
… layout.ts Extract CATEGORY_DISPLAY from queue.ts and the equivalent CATEGORY_LABELS/CATEGORY_COLORS from repos.ts into a single shared constant in layout.ts, eliminating data duplication that required lockstep updates across two files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The queue category labels and colors are defined independently in two files:
src/pages/repos.ts:7-25definesCATEGORY_LABELSandCATEGORY_COLORSas two separateRecord<QueueCategory, string>constantssrc/pages/queue.ts:5-13definesCATEGORY_DISPLAYas a combinedRecord<QueueCategory, { label: string; color: string }>Both contain identical data (same 7 categories, same labels, same hex colors). If a category is added or a color changes, both files must be updated in lockstep.
Extract a single
CATEGORY_DISPLAYconstant intosrc/pages/layout.ts(which already serves as the shared page utility module) and import it from both files. The combined{ label, color }structure from queue.ts is the better shape since it co-locates related data.Automated improvement by yeti improvement-identifier