feat(v1): TypeStripe + DetailCard slot (Phase 1 - Foundation PR 5)#483
Open
vitorvasc wants to merge 4 commits into
Open
feat(v1): TypeStripe + DetailCard slot (Phase 1 - Foundation PR 5)#483vitorvasc wants to merge 4 commits into
vitorvasc wants to merge 4 commits into
Conversation
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
✅ Deploy Preview for otel-ecosystem-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a reusable “TypeStripe” UI primitive (and shared color palette) to visually indicate OpenTelemetry Collector component type, and adds an optional slot on DetailCard to render that stripe in a consistent, centralized way as part of the V1 redesign foundation work.
Changes:
- Added
TYPE_STRIPE_COLORSandCollectorComponentType(derived fromCollectorComponent["type"]) for a single source of truth on stripe colors. - Added
<TypeStripe type="..." />primitive that renders anaria-hiddencolored stripe with adata-typeattribute. - Extended
<DetailCard>with an optionaltypeStripeprop that mounts<TypeStripe>with standardized positioning styles, plus initial unit tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ecosystem-explorer/src/components/ui/type-stripe-colors.ts | Defines the canonical collector component type union alias and the shared HSL color map. |
| ecosystem-explorer/src/components/ui/type-stripe.tsx | Implements the standalone TypeStripe primitive rendering the inline background color + attributes. |
| ecosystem-explorer/src/components/ui/detail-card.tsx | Adds typeStripe prop to render TypeStripe in a consistent left-edge slot within DetailCard. |
| ecosystem-explorer/src/components/ui/type-stripe.test.tsx | Adds tests for TypeStripe and the exported color map (needs a stronger assertion for color correctness). |
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.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.
Contributes to #84 and #370.
What's in this PR
src/components/ui/type-stripe-colors.tsexporting the shared types and palette:CollectorComponentTypederived fromCollectorComponent["type"]insrc/types/collector.ts(the canonical union ofreceiver,processor,exporter,connector,extension)TYPE_STRIPE_COLORS: Record<CollectorComponentType, string>HSL map (hardcoded HSL strings, not theme tokens)<TypeStripe type="..." />atsrc/components/ui/type-stripe.tsx. Renders anaria-hidden<span>with the matching background color inline, atype-stripeclass hook, and adata-typeattribute. AcceptsclassNamefor sizing and positioning<DetailCard>accepts an optionaltypeStripe?: CollectorComponentTypeprop. When set, the card mounts<TypeStripe>with the Tailwindabsolute inset-y-0 left-0 w-1positioning class, so the stripe rendering lives in one place. Existing<DetailCard>consumers compile and render unchangedit.eachacross all fiveCollectorComponentTypevalues and assert both thedata-typeattribute and the inline background color match the mapWhat's not in this PR
<TypeStripe>yet. The first consumers will be the list view and the detail header.type-stripeCSS class is defined yet. The standalone<TypeStripe>sets onlybackground-colorinline, so callers must pass a sizingclassNameto make it visible.<DetailCard>'s slot is self-contained via Tailwind, so this gap only matters for callers that want to mount the bare primitiveVerification
bun run typecheckcleanbun run lintcleanbun run test src/components/ui/type-stripe.test.tsxpasses 6/6bun run testpasses 843/843bun run formatno reformatting needed