Conversation
* feat: 134-max-question-reoccurrences (#232) * feat: add max question reoccurrences slider * feat: add max question reoccurrences slider * feat: max question reoccurrences logic * refactor: use utils function * refactor: slider change * feat: add slider descriptions * refactor: edit session answers count logic * refactor: upgrade save slider values * refactor: upgrade settings logic * refactor: upgrade settings slider logic * refactor: change default settings * feat: new settings form * refactor: responsive * fix: bug fixes * refactor: settings change * refactor: buttons change * feat: add account level badge for gold users and update profile display * feat: new brainrot options * refactor: copilot suggestions * refactor: change Minecraft parkour video --------- Co-authored-by: Antoni Czaplicki <antekczaplicki@gmail.com>
* refactor: base ui and settings improvements # Conflicts: # src/components/navbar/auth-buttons.tsx # src/components/profile/settings-form.tsx # src/components/quiz/brainrot-card.tsx * refactor: dev * chore: add icons library * refactor: change icon library * chore: remove icons package * feat: nested dialogs * refactor: lock * refactor: lint
Contributor
There was a problem hiding this comment.
Pull request overview
Dodanie obsługi haptics (wibracji) w aplikacji poprzez nowy hook oraz podpięcie go do wybranych interakcji UI (przyciski, switche, quiz, import).
Changes:
- Dodano zależność
web-hapticsoraz hookuseHapticsdo wyzwalania presetów wibracji. - Podpięto haptics do importu quizu, tworzenia quizu oraz kluczowych akcji w rozwiązywaniu quizu.
- Rozszerzono komponent
Buttono opcjonalne haptics na klik oraz dodano wibracje doSwitchi ustawień.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/import-quiz.ts | Haptics dla success/error przy imporcie quizu. |
| src/hooks/haptics.ts | Nowy hook integrujący web-haptics + stan w localStorage. |
| src/components/ui/switch.tsx | Dodanie wibracji przy interakcji z przełącznikiem. |
| src/components/ui/button.tsx | Flaga hapticsOnClick do wibracji na klik. |
| src/components/quiz/question-card.tsx | Haptics przy zaznaczaniu odpowiedzi oraz akcjach nawigacyjnych. |
| src/components/quiz/hooks/use-quiz-logic.ts | Haptics success/error po sprawdzeniu odpowiedzi. |
| src/components/profile/settings-form.tsx | UI do włączenia/wyłączenia haptics + haptics na przyciskach +/- . |
| src/app/create-quiz/client.tsx | Haptics success/error przy zapisie quizu. |
| package.json | Dodanie web-haptics. |
| package-lock.json | Lockfile dla web-haptics. |
Comments suppressed due to low confidence (1)
src/components/ui/switch.tsx:31
- W
Switchhaptics są podpinane przezonClick, ale potem robisz{...props}po tym handlerze. Jeśli ktoś przekaże własnyonClickw propsach, to nadpisze on ten z hapticsami i wibracja przestanie działać. Lepiej jawnie zmergować handlery (wywołać propsoweonClick+ haptics) albo rozważyć użycieonCheckedChangezamiastonClick.
<SwitchPrimitive.Root
data-slot="switch"
data-size={size}
role="switch"
onClick={async () => {
await haptics.vibrate("selection");
}}
className={cn(
"peer aria-checked:dark:bg-accent-input bg-accent-input dark:bg-input/80 inline-flex h-6 w-12 shrink-0 items-center rounded-[10px] border border-transparent shadow-xs transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-checked:bg-(--cta-gradient-from)",
"focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px]",
className,
)}
{...props}
>
Member
|
Let’s put it on hold until we know if it’s going to be supported in iOS in the feature lochie/web-haptics#36 |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/components/ui/switch.tsx:31
- Because
{...props}is spread afteronClick, any consumer-providedonClickwill override this handler and haptics won’t trigger. If you want Switch haptics to be reliable while still allowing consumers to handle clicks, destructureonClickfrom props and compose it (call the consumer handler first/last, then trigger haptics), and spread the remaining props.
"focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px]",
className,
)}
{...props}
>
Member
|
closing for now as looks like haptics were disabled for good on safari |
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.
Dodałem hapticsy
Important
iOS i ogólnie wiele przeglądarek ma problemy z tymi hapticsami i może nie działać
Zostały dodane do:
Ustawienie zapisuje się tylko lokalnie w

localStorageper urządzenie.Oddzieliłem hapticsy od reszty ustawień aby się nie mieszały.
Nie miałem pomysłu na więcej hapticsów aby też nie nawalić tego bez sensu.
CLOSES #239