Add id prop to BoardEntityBadge and update usage in useBoardEntityBad…#4340
Add id prop to BoardEntityBadge and update usage in useBoardEntityBad…#4340vedantbhavsar26 wants to merge 2 commits into
Conversation
|
@vedantbhavsar26 is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR makes
Confidence Score: 4/5Safe to merge — the navigation links point to confirmed existing routes and the component renders correctly for all entity types. The core feature (clickable badge with correct routing) is solid. The only concern is useBoardEntityBadgeProps.ts — the pixel branch sets Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Board as Board View
participant Hook as useBoardEntityBadgeProps
participant Badge as BoardEntityBadge
participant Router as Next.js Router
Board->>Hook: useBoardEntityBadgeProps(entityType, entityId)
Hook-->>Board: "{ id, type, name, domain? } | null"
Board->>Badge: "<BoardEntityBadge id={id} type={type} name={name} domain={domain} />"
Badge->>Router: "<Link href={`/{type}s/{id}`}>"
Note over Badge,Router: /websites/{id}<br>/pixels/{id}<br>/links/{id}
Router-->>Badge: Navigates on click
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Board as Board View
participant Hook as useBoardEntityBadgeProps
participant Badge as BoardEntityBadge
participant Router as Next.js Router
Board->>Hook: useBoardEntityBadgeProps(entityType, entityId)
Hook-->>Board: "{ id, type, name, domain? } | null"
Board->>Badge: "<BoardEntityBadge id={id} type={type} name={name} domain={domain} />"
Badge->>Router: "<Link href={`/{type}s/{id}`}>"
Note over Badge,Router: /websites/{id}<br>/pixels/{id}<br>/links/{id}
Router-->>Badge: Navigates on click
Reviews (1): Last reviewed commit: "Add id prop to BoardEntityBadge and upda..." | Re-trigger Greptile |
|
|
||
| if (entityType === 'pixel' && pixel?.name) { | ||
| return { type: entityType, name: pixel.name }; | ||
| return { type: entityType, name: pixel.name, domain: pixel.id, id: pixel.id }; |
There was a problem hiding this comment.
The
domain field is being set to pixel.id, but the domain prop on BoardEntityBadge is passed to <Favicon domain={domain} /> and is semantically a website hostname. For a pixel entity, this value is never consumed by the component (pixel type renders <Grid2x2 /> instead of <Favicon>), so there is no visual regression right now — but if the component ever references domain for pixels in the future, it will receive a UUID instead of a hostname. The field should be omitted or set to undefined.
| return { type: entityType, name: pixel.name, domain: pixel.id, id: pixel.id }; | |
| return { type: entityType, name: pixel.name, id: pixel.id }; |
…geProps
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.