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 Ready Ready Preview, Comment Feb 10, 2026 10:54pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 10, 2026 10:54pm
npmx-lunaria Ignored Ignored Feb 10, 2026 10:54pm

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 and Algolia-specific input logic were removed. In app/components/Header/SearchBox.vue the updater was renamed to updateUrlQuery, it now navigates immediately (replace when already on search, push to search otherwise), and route checks use route.name (including a local-filter pages guard). Watchers now sync URL→input only when the computed URL value differs and trigger input→URL only for the search route. Submit handlers trim the query, avoid navigating from local-filter pages when empty, and navigate to search with { q: trimmed } when appropriate. app/pages/index.vue no longer binds debounced/input handlers and always navigates with { q: query }. Two E2E tests were updated to press Enter after typing to trigger navigation.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description 'Searches on enter key press' directly relates to the changeset, which modifies search functionality to trigger on Enter key press rather than debounce.

✏️ 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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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()
-  }
-}

@gameroman
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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