Skip to content

Conversation

sosweetham
Copy link
Member

@sosweetham sosweetham commented Oct 14, 2025

Description of change

Issue Number

Type of change

  • Breaking (any change that would cause existing functionality to not work as expected)
  • New (a change which implements a new feature)
  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)
  • Docs (changes to the documentation)
  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • New Features
    • No user-facing feature changes in this release.
  • Refactor
    • Migrated the drawer’s swipe interaction to a newer gesture handler for smoother, more reliable swipe-down-to-close behavior across devices. User behavior remains the same.
  • Chores
    • Removed unused placeholder dependencies from the Pictique package to streamline the build and reduce bundle noise. No impact on app functionality.

@sosweetham sosweetham requested a review from coodos as a code owner October 14, 2025 00:39
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Removed placeholder dependencies from platforms/pictique/package.json. Migrated Drawer.svelte swipe handling from the old swipe directive to the new useSwipe API, wiring a downward swipe to trigger drawer destruction. No public API changes.

Changes

Cohort / File(s) Summary
Dependencies cleanup
platforms/pictique/package.json
Removed placeholder dependencies "-" (^0.0.1) and "D" (^1.0.0); no additions.
Gesture handling migration
platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte
Replaced svelte-gestures swipe directive with useSwipe; removed SwipeCustomEvent handler; added downSwipeHandler invoked on swipedown to destroy drawer; updated imports accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant D as Drawer.svelte
  participant G as svelte-gestures useSwipe

  U->>D: Swipe down gesture
  D->>G: useSwipe listens to swipe
  G-->>D: swipedown event
  D->>D: downSwipeHandler()
  D->>D: destroy/close drawer
  note over D: Drawer closes on downward swipe (via useSwipe)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • feat:Drawer #152 — Also updates Drawer.svelte to handle downward swipe closure via svelte-gestures changes.

Suggested reviewers

  • coodos

Poem

A twitch of the whiskers, a downward glide,
The drawer now closes with a gentle slide.
Two ghostly deps hop out of sight—
Lighter paws, the UI feels right.
hop hop, swipe stop 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is merely the unmodified template with no details filled in, so it does not provide any information about what was changed, how it was tested, the type of change, or the associated issue number, and none of the checklist items are completed. Please complete the description template by summarizing the actual changes made, referencing the related issue number, selecting the appropriate change type, detailing how the change was tested, and marking each checklist item to confirm CI success, removed logic, documentation quality, signed commits, adherence to project patterns, and self-review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the main change by indicating a fix to how the Svelte gesture dependency is used and directly relates to the updated swipe handling in the Drawer component. It is concise, clear, and focused on the core update without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte (1)

21-23: Consider consolidating duplicate drawer destruction logic.

downSwipeHandler() duplicates the logic in dismiss() (lines 17-19). Both destroy the drawer with animation.

You could simplify by reusing dismiss():

-	function downSwipeHandler() {
-		drawer?.destroy({ animate: true });
-	}
+	const downSwipeHandler = dismiss;

Or if you prefer to keep them separate for clarity, the current implementation is also acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3e3b19 and c0230c4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • platforms/pictique/package.json (0 hunks)
  • platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte (3 hunks)
💤 Files with no reviewable changes (1)
  • platforms/pictique/package.json

import { cn } from '$lib/utils';
import { swipe } from 'svelte-gestures';
import type { SwipeCustomEvent } from 'svelte-gestures';
import { useSwipe, type GestureCustomEvent, type SwipeCustomEvent } from 'svelte-gestures';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove unused type imports.

GestureCustomEvent and SwipeCustomEvent are imported but not referenced anywhere in the code.

Apply this diff to remove the unused imports:

-	import { useSwipe, type GestureCustomEvent, type SwipeCustomEvent } from 'svelte-gestures';
+	import { useSwipe } from 'svelte-gestures';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { useSwipe, type GestureCustomEvent, type SwipeCustomEvent } from 'svelte-gestures';
import { useSwipe } from 'svelte-gestures';
🤖 Prompt for AI Agents
In platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte around line 6, the
import currently brings in unused type symbols GestureCustomEvent and
SwipeCustomEvent; remove those unused type imports so the line only imports
useSwipe (and any other actually used exports) to eliminate dead imports and
TypeScript lint warnings.

Comment on lines +48 to +57
{...useSwipe(
() => {},
() => ({
timeframe: 300,
minSwipeDistance: 60
}),
{
onswipedown: downSwipeHandler
}
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the useSwipe API usage pattern.

The useSwipe call has an empty first parameter () => {} and wraps the configuration in a function. Confirm this matches the svelte-gestures API documentation for correct usage.

Please search the web to verify the correct useSwipe API signature:


🌐 Web query:

svelte-gestures useSwipe API documentation and usage examples

💡 Result:

Summary — useSwipe (svelte-gestures)

  • Import:
    import { useSwipe, type SwipeCustomEvent, type GestureCustomEvent } from 'svelte-gestures'. [1][2]

  • Hook signature / usage pattern:
    Spread the action result onto an element: {...useSwipe(handler, () => (options))}. The first arg is your event handler (receives a SwipeCustomEvent); second is a function that returns options. Example below. [1]

  • Events & detail payload:

    • Main event: "swipe" — event.detail contains at least: direction (string: 'left'|'right'|'up'|'down'), pointerType, target (HTMLElement). There are also per-phase events like swipeup / swiperight / swipedown / swipeleft and gesture-phase events with names like swipeup, swipedown, swipemove that carry GestureCustomEvent payload (includes native pointer event, pointersCount, x, y, target). [2][1]
  • Common options (examples shown in README):

    • timeframe: number (ms) — window in which movement counts as swipe.
    • minSwipeDistance (or minSwipe): number (px) — minimum distance required to trigger swipe.
    • touchAction: CSS touch-action to set on the element (e.g. 'none').
      (Options are passed via the options function you give to useSwipe.) [1][2]

Minimal example

<script lang="ts"> import { useSwipe, type SwipeCustomEvent } from 'svelte-gestures'; let dir: string | null = null; function handler(e: SwipeCustomEvent) { dir = e.detail.direction; // e.detail.pointerType, e.detail.target available } </script>
({ timeframe: 300, minSwipeDistance: 50, touchAction: 'none' }))}>
swipe direction: {dir}

References

  • svelte-gestures usage & useSwipe example (README / package docs). [1]
  • svelte-gestures npm page (API events, options notes). [2]

[1] svelte-gestures README / docs (usage example).
[2] svelte-gestures — npm package page (API events & options).


Remove unsupported third argument from useSwipe
In platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte (lines 48–57), call useSwipe(handler, () => options) only; move onswipedown={downSwipeHandler} into the element’s markup (e.g. <div on:swipedown={downSwipeHandler} {...useSwipe(...)}>).

🤖 Prompt for AI Agents
In platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte around lines 48–57
the call to useSwipe incorrectly passes a third argument for onswipedown
(unsupported); change the invocation to useSwipe(() => {}, () => ({ timeframe:
300, minSwipeDistance: 60 })) and remove the third argument, then attach the
downSwipeHandler directly on the element that spreads useSwipe (e.g. add
on:swipedown={downSwipeHandler} to the wrapper div or the element receiving the
swipe directives) so the handler is invoked via Svelte event binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant