Repository navigation
Conversation
…Y_LABELS constants CATEGORY_LABELS was defined identically in vendor-form.tsx and vendor-category-section.tsx. The ordered category list appeared as VENDOR_CATEGORIES in vendor-form.tsx and CATEGORY_ORDER in index.tsx. Consolidates both into a single vendor-constants.ts module so any future category label change is made in one place with no drift risk.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
This was referenced Sep 3, 2026
This branch had an error being deployed
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.
Daily Product Improvement
Summary
Extracted the duplicated
CATEGORY_LABELSand vendor category list into a single sharedvendor-constants.tsmodule, removing identical definitions that existed across three files.Recommendations Reviewed
1. Extract duplicated
CATEGORY_LABELSinto a shared vendor constants filevendor-form.tsx,vendor-category-section.tsx,vendor/index.tsxCATEGORY_LABELSwas defined identically in two files. The ordered category list appeared asVENDOR_CATEGORIESin one file andCATEGORY_ORDERin another — same values, different names.vendor-constants.tsmodule imported by all three files.2. Remove redundant dual state in
QuoteFileUploadervendor-detail-panel.tsxisSubmittingandisUploadingare always set to the same value simultaneously;const busy = isSubmitting || isUploadingis never independently differentiated.isBusystate.3.
VendorApiWithEnrichmenttype cast bypasses TypeScript safetyvendor-detail-panel.tsxVendorApiWithEnrichmenttype is cast ontoapi.vendor, indicating the enrichment endpoints aren't in the tRPC router type.4. Vendor scratchpad requires explicit save — inconsistent with auto-saving toggles
vendor-detail-panel.tsx5.
vendor-detail-panel.tsxis 936 lines and handles too many responsibilitiesvendor-detail-panel.tsxVendorQuotesSection,VendorNotesSection).Selected Improvement
Extract
CATEGORY_LABELSand the ordered category list out of three separate vendor files into a singlevendor-constants.tsmodule.Why This Was Selected
Both
CATEGORY_LABELSrecords were byte-for-byte identical. The category order list carried two different names (VENDOR_CATEGORIESvsCATEGORY_ORDER) for the same eight values. Any future addition of a vendor category (or label correction) required finding and updating multiple files — a classic drift risk. This fix is small, safe, and immediately reduces maintenance surface with zero behavior change.Changes Made
src/components/vendor/vendor-constants.tsexportingVENDOR_CATEGORIESandVENDOR_CATEGORY_LABELSCATEGORY_LABELSdefinition fromvendor-form.tsxandvendor-category-section.tsxVENDOR_CATEGORIESfromvendor-form.tsxandCATEGORY_ORDERfromvendor/index.tsxFiles Changed
src/components/vendor/vendor-constants.ts(new)src/components/vendor/index.tsxsrc/components/vendor/vendor-category-section.tsxsrc/components/vendor/vendor-form.tsxVerification
tsc --noEmit— no new type errorsbiome check— 17 pre-existing nursery warnings, no new errorsFuture Recommendations
Collapse redundant dual state in
QuoteFileUploaderRemove
VendorApiWithEnrichmenttype castAuto-save vendor scratchpad on blur
Split
vendor-detail-panel.tsxinto focused sub-componentsGitHub Issues Created or Proposed
No issues created. The two Medium-priority recommendations above (type cast cleanup and auto-save scratchpad) are proposed as future GitHub issues. Neither met the bar for creation today — the type cast requires investigation scope and the auto-save is a product UX decision that should have design input before tracking.
Generated by Claude Code