Conversation
Co-authored-by: paul.jaffre <paul.jaffre@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle ReportChanges will increase total bundle size by 91.16kB (0.4%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
Files in
Files in
App Routes Affected:
|
Co-authored-by: paul.jaffre <paul.jaffre@sentry.io>
| {shouldUseNextImage && dimensions ? ( | ||
| <Image | ||
| src={getImageUrl(src, imgPath)} | ||
| alt={alt} | ||
| width={dimensions.width} | ||
| height={dimensions.height} | ||
| className="max-h-[90vh] max-w-[90vw] object-contain" | ||
| style={{ | ||
| width: 'auto', | ||
| height: 'auto', | ||
| }} | ||
| priority | ||
| {...imageCompatibleProps} | ||
| /> | ||
| ) : ( | ||
| /* eslint-disable-next-line @next/next/no-img-element */ | ||
| <img | ||
| src={getImageUrl(src, imgPath)} | ||
| alt={alt} | ||
| loading="lazy" | ||
| decoding="async" | ||
| className="max-h-[90vh] max-w-[90vw] object-contain" | ||
| style={{ | ||
| width: 'auto', | ||
| height: 'auto', | ||
| }} | ||
| {...props} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
can we pass a isInline boolean to renderImage and then add classNAme if not? otherwise it's very similar to the function above
| }; | ||
|
|
||
| return ( | ||
| <Dialog.Root open={open} onOpenChange={setOpen}> |
There was a problem hiding this comment.
I would still abstract Dialog or call it Lightbox as it's own reusable component similar to ShadCN https://ui.shadcn.com/docs/components/dialog to consume in here.
| return ( | ||
| <Dialog.Root open={open} onOpenChange={setOpen}> | ||
| {/* Custom trigger that handles modifier keys properly */} | ||
| <div |
There was a problem hiding this comment.
have you tried using Dialog.Trigger? I think that would eliminate the need for custom onClick / keydown handling and would do semantics / accessibility for us?
There was a problem hiding this comment.
Things were getting wonky with the intended behavior and needed some custom event handling but things have changed a bit since then. I'll see if we can't lean on this now
| <div | ||
| onClick={handleModifierClick} | ||
| onKeyDown={handleModifierKeyDown} | ||
| onClick={handleClick} | ||
| onAuxClick={handleClick} | ||
| onKeyDown={handleKeyDown} | ||
| className="cursor-pointer border-none bg-transparent p-0 block w-full no-underline" | ||
| aria-label={`View image: ${alt}`} | ||
| role="button" | ||
| tabIndex={0} |
There was a problem hiding this comment.
i dont think it needs this (apart from aira-label) because https://github.com/radix-ui/primitives/blob/main/packages/react/dialog/src/dialog.tsx#L105-L107 handles it
There was a problem hiding this comment.
Oh nice. Less code is the best code! I still need some of it for the modifier logic but can pull some off
There was a problem hiding this comment.
yup and you can put all that on the <Dialog.Trigger /> directly and remove the asChild prop
Co-authored-by: Sergiy Dybskiy <sergiy.dybskiy@sentry.io>
9200f86 to
5dc9bcd
Compare
| <Lightbox.Root open={open} onOpenChange={setOpen} content={renderImage(false)}> | ||
| <Lightbox.Trigger | ||
| onClick={handleClick} | ||
| onAuxClick={handleClick} | ||
| onKeyDown={handleKeyDown} | ||
| className="cursor-pointer border-none bg-transparent p-0 block w-full no-underline" | ||
| aria-label={`View image: ${alt}`} | ||
| > | ||
| {renderImage()} | ||
| </Lightbox.Trigger> | ||
| </Lightbox.Root> |
* 'master' of https://github.com/getsentry/sentry-docs: (22 commits) Fix incorrectly placed comma (#14592) fix(devservices): Typo in devservices docs (#14636) ref(ourlogs): Add log size limit (#14635) Document undocumented php prefix option (#14634) getsentry/relay@7958273 Unreal Engine: Update plugin docs (#14624) feat: Update min js sdk version for logging and update console logging snippet (#14614) feat: [Unreal] Add transaction and span set_data documentation (#14599) feat(js): Add `ignoreSpans` documentation to Options page (#14572) fix(js/browser): Amend user IP + `sendDefaultPii` change to v10 migration guide (#14609) fix: Fix broken AI banner due to invalid syntax (#14627) feat(partners)add-enablement-docs (#14095) Fix image path issue & add test coverage for new lightbox (#14616) feat(seer): update GHE setup to work with seer (#14617) fix(replay): Document searchable properties `screen` and alias `screens` (#14603) Update image handling (#14564) Update using-hooks.mdx (#14605) Godot: Document `disabled-in-editor-play` option (#14438) fix(Docs) redirect and deprecate old metrics pages (#14602) fix(relay): Update projects.mdx (#14606) ...
DESCRIBE YOUR PR
This PR implements a modern image lightbox for all documentation images, enhancing the user experience.
Previously, clicking an image would open the raw image file in a new browser tab. This change introduces an in-page modal overlay for images, leveraging Radix UI Dialog for accessibility and a smooth user experience.
Key features:
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES