-
Notifications
You must be signed in to change notification settings - Fork 3.3k
improvement(docs): added images and videos to quick references #3004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile SummaryEnhanced the quick reference documentation with visual media (images and videos). The PR introduces a new Key Changes
Notes
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant MDX as Quick Reference MDX
participant ActionMedia as ActionImage/ActionVideo
participant Utils as getAssetUrl()
participant CDN as Vercel Blob/Static
User->>Browser: Navigate to /quick-reference
Browser->>MDX: Render documentation page
MDX->>ActionMedia: Render ActionImage/ActionVideo components
ActionMedia->>Utils: getAssetUrl(src)
alt CDN configured (NEXT_PUBLIC_BLOB_BASE_URL set)
Utils->>ActionMedia: Return CDN URL
ActionMedia->>CDN: Fetch video/image from Blob storage
else No CDN (local development)
Utils->>ActionMedia: Return local path
ActionMedia->>CDN: Fetch from /public/static
end
CDN->>ActionMedia: Return media file
ActionMedia->>Browser: Render <img> or <video> element
Browser->>User: Display visual quick reference guide
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 4 comments
| <img | ||
| src={resolvedSrc} | ||
| alt={alt} | ||
| className='inline-block w-full max-w-[200px] rounded border border-neutral-200 dark:border-neutral-700' | ||
| /> | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing width and height attributes which are important for layout stability and avoiding CLS (Cumulative Layout Shift). The existing Image component (apps/docs/components/ui/image.tsx:13-53) uses Next.js Image component which handles dimensions properly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/components/ui/action-media.tsx
Line: 19:24
Comment:
Missing `width` and `height` attributes which are important for layout stability and avoiding CLS (Cumulative Layout Shift). The existing `Image` component (apps/docs/components/ui/image.tsx:13-53) uses Next.js Image component which handles dimensions properly.
How can I resolve this? If you propose a fix, please make it concise.| <video | ||
| src={resolvedSrc} | ||
| autoPlay | ||
| loop | ||
| muted | ||
| playsInline | ||
| className='inline-block w-full max-w-[200px] rounded border border-neutral-200 dark:border-neutral-700' | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing aria-label attribute for accessibility. The existing Video component pattern (apps/docs/components/ui/video.tsx:36-44) doesn't include this either, but it's a best practice for videos to have descriptive ARIA labels.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/components/ui/action-media.tsx
Line: 31:38
Comment:
Missing `aria-label` attribute for accessibility. The existing `Video` component pattern (apps/docs/components/ui/video.tsx:36-44) doesn't include this either, but it's a best practice for videos to have descriptive ARIA labels.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| export function ActionImage({ src, alt }: ActionImageProps) { | ||
| const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src) | ||
|
|
||
| return ( | ||
| <img | ||
| src={resolvedSrc} | ||
| alt={alt} | ||
| className='inline-block w-full max-w-[200px] rounded border border-neutral-200 dark:border-neutral-700' | ||
| /> | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider reusing the existing Image component (apps/docs/components/ui/image.tsx:13-53) instead of creating a separate implementation. The existing component uses Next.js Image for better performance and includes lightbox functionality.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/components/ui/action-media.tsx
Line: 15:25
Comment:
Consider reusing the existing `Image` component (apps/docs/components/ui/image.tsx:13-53) instead of creating a separate implementation. The existing component uses Next.js Image for better performance and includes lightbox functionality.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| } | ||
|
|
||
| export function ActionImage({ src, alt }: ActionImageProps) { | ||
| const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getAssetUrl function already handles paths without leading slashes (apps/docs/lib/utils.ts:16-22), so the src.startsWith('/') check and slice(1) logic may be unnecessary duplication.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/components/ui/action-media.tsx
Line: 16:16
Comment:
The `getAssetUrl` function already handles paths without leading slashes (apps/docs/lib/utils.ts:16-22), so the `src.startsWith('/')` check and `slice(1)` logic may be unnecessary duplication.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| playsInline | ||
| className='inline-block w-full max-w-[200px] rounded border border-neutral-200 dark:border-neutral-700' | ||
| /> | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused alt prop in ActionVideo component
Low Severity
The ActionVideo component accepts an alt prop but never uses it. The <video> HTML element doesn't support the alt attribute like <img> does. All callers in the documentation pass alt values expecting them to provide accessibility information, but the values are silently discarded. For video accessibility, aria-label={alt} could be added to the video element.
Summary
Type of Change
Testing
N/A
Checklist