fix: unify prompt card actions across screen widths and align breakpoints - #116
Open
rahulkr182 wants to merge 1 commit into
Open
fix: unify prompt card actions across screen widths and align breakpoints#116rahulkr182 wants to merge 1 commit into
rahulkr182 wants to merge 1 commit into
Conversation
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.
What does this change?
Fixes #98
Fixes #45
src/components/prompts/PromptCard.tsx.MOBILE_BREAKPOINT = 768fromsrc/hooks/use-mobile.tsx.src/components/prompts/PromptCard.tsxfromlg(1024px) tomd(768px), eliminating the mismatch between card controls and modal dialogs (SharePromptDialog,ReportPromptDialog) in the 768px-1024px tablet range.[@media(hover:none)]:!opacity-100andmd:focus-visible:opacity-100to the card image copy prompt button, ensuring it remains visible and accessible on touch screens (such as iPad Pro at 1024px).src/components/prompts/AiToolBadge.tsxinteractive on tap/click (type="button") to toggle between the abbreviated label and full tool name without requiring hover/tooltip.aria-label={AI tool: ${tool}}.src/hooks/use-mobile.test.tsxverifyingMOBILE_BREAKPOINTanduseIsMobile.src/components/prompts/AiToolBadge.test.tsxverifying label toggling and accessibility.src/components/prompts/PromptCard.test.tsxverifying complete action suites in both menus and touch override styling.Why?
Previously,
PromptCardoffered different actions depending on width:lg:), which meant touch devices at 1024px (iPad Pro) couldn't copy prompts or like posts (bug: current not possible for copying prompt (IPad Pro) #45).useIsMobile), creating an inconsistent intermediate state between 768px and 1024px.AiToolBadgerelied solely on browsertitleattributes, rendering full tool names inaccessible on touch screens.How was it tested?
src/hooks/use-mobile.test.tsx.src/components/prompts/AiToolBadge.test.tsx.src/components/prompts/PromptCard.test.tsx.npm run lint(0 errors)npm run typecheck(0 errors)npm test(all 17 test files and 89 tests passed)npm run build(production build succeeded)npm run db:schema:check(up to date)Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpasses/foo.png) is inpublic/, notsrc/assets/.envfiles are included