Skip to content

Conversation

@gameroman
Copy link
Contributor

@gameroman gameroman commented Feb 8, 2026

Searches on enter key press

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Error Error Feb 9, 2026 7:29pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Feb 9, 2026 7:29pm
npmx-lunaria Ignored Ignored Feb 9, 2026 7:29pm

Request Review

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Header/SearchBox.vue 0.00% 6 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

@gameroman gameroman marked this pull request as ready for review February 8, 2026 17:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Debounce-based URL synchronisation and the debounce import were removed. In app/components/Header/SearchBox.vue, URL updates and the input watcher now act only when the current route is named "search"; URL-to-input sync updates searchQuery only when the computed URL value differs; submit trims the query, avoids navigating from local-filter pages when the trimmed value is empty, flushes the debounced updater when already on search, and otherwise navigates to search with { q: trimmedQuery }. In app/pages/index.vue the input handler, its binding and recursive retry logic were removed and search() always navigates with { q: query }. E2E tests now trigger navigation by sending Enter after typing in two specs.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description 'Searches on enter key press' directly relates to the changeset, which removes debounce-based input handling and adds explicit Enter key press navigation triggers across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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: 1

@whitep4nth3r whitep4nth3r changed the title fix fix: only search on enter keypress Feb 8, 2026
@gameroman
Copy link
Contributor Author

I need to fix the tests now

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: 1

🧹 Nitpick comments (1)
app/components/Header/SearchBox.vue (1)

47-49: Consider adding a type guard for route.name.

route.name can be string | symbol | null | undefined, whilst pagesWithLocalFilter is a Set<string>. Although Set.has() handles mismatched types gracefully at runtime (returning false), an explicit type check would satisfy strict type safety. The same pattern appears on line 59.

♻️ Proposed type-safe guard
-    if (pagesWithLocalFilter.has(route.name)) {
+    if (typeof route.name === 'string' && pagesWithLocalFilter.has(route.name)) {

Apply the same pattern at line 59.

As per coding guidelines: "Ensure you write strictly type-safe code".

@ghostdevv
Copy link
Contributor

I think this is a duplicate of #1107 unfortunately

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/pages/index.vue (1)

18-29: ⚠️ Potential issue | 🟡 Minor

Remove unused debounce handlers.

The handleInputNpm, handleInputAlgolia, and handleInput functions defined on lines 18–29 are never called — there is no @input binding on the InputBase component. Since the PR's intent is to search only on Enter keypress (via form submit on line 74), these functions and the debounce dependency are redundant and should be removed.

🧹 Proposed fix to remove dead code
-const handleInputNpm = debounce(search, 250, { leading: true, trailing: true })
-const handleInputAlgolia = debounce(search, 80, { leading: true, trailing: true })
-
-function handleInput() {
-  if (isTouchDevice()) {
-    search()
-  } else if (isAlgolia.value) {
-    handleInputAlgolia()
-  } else {
-    handleInputNpm()
-  }
-}

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants