Skip to content

Search improvements#703

Merged
feruzm merged 4 commits intodevelopfrom
search
Mar 14, 2026
Merged

Search improvements#703
feruzm merged 4 commits intodevelopfrom
search

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 14, 2026

Summary by CodeRabbit

  • Refactor

    • Switched search to in-app lookups for improved performance and reliability.
    • Reduced default topic search results from 20 to 10.
    • Updated profile sourcing so search shows names and bios from nested profile data.
    • Updated default fallback image path for missing avatars to /assets/noimage.svg.
  • Bug Fixes

    • Expanded social-bot detection to cover more crawlers, improving URL handling for bot traffic.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8c7137c-2ce9-4279-af3d-41e5334687c8

📥 Commits

Reviewing files that changed from the base of the PR and between 12ca307 and 1a6fc4f.

⛔ Files ignored due to path filters (6)
  • packages/sdk/dist/browser/index.js is excluded by !**/dist/**
  • packages/sdk/dist/browser/index.js.map is excluded by !**/dist/**, !**/*.map
  • packages/sdk/dist/node/index.cjs is excluded by !**/dist/**
  • packages/sdk/dist/node/index.cjs.map is excluded by !**/dist/**, !**/*.map
  • packages/sdk/dist/node/index.mjs is excluded by !**/dist/**
  • packages/sdk/dist/node/index.mjs.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (6)
  • apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/redditbot/route.ts
  • packages/sdk/CHANGELOG.md
  • packages/sdk/package.json
  • packages/sdk/src/modules/search/queries/get-search-topics-query-options.ts
  • packages/wallets/CHANGELOG.md
  • packages/wallets/package.json

📝 Walkthrough

Walkthrough

Migrates search from external HTTP endpoints to Hive client calls, updates UI to read nested profile metadata, removes legacy search request functions and types, adjusts query keys and limits, expands social-bot detection, and bumps package versions and changelogs.

Changes

Cohort / File(s) Summary
Search UI
apps/web/src/app/search/_components/search-people/index.tsx, apps/web/src/app/search/_components/search-topics/index.tsx, apps/web/src/features/shared/search-list-item/index.tsx
People component now reads metadata.profile.{name,about} for display and uses username variable; topics map callback simplified; fallback image path changed from /public/assets/noimage.svg/assets/noimage.svg.
Search Query Logic
packages/sdk/src/modules/search/queries/get-search-account-query-options.ts, packages/sdk/src/modules/search/queries/get-search-topics-query-options.ts, packages/sdk/src/modules/core/query-keys.ts
Removed random params, changed topics default limit (20→10), normalize input (q.trim()), switched from external POSTs to CONFIG.hiveClient.database.call (lookup_accounts, get_trending_tags), changed query keys to include limit, and updated return types to Profile[] and string[].
SDK API Surface Cleanup
packages/sdk/src/modules/search/requests.ts, packages/sdk/src/modules/search/types/account-search-result.ts, packages/sdk/src/modules/search/types/tag-search-result.ts, packages/sdk/src/modules/search/types/index.ts
Removed searchAccount/searchTag request functions and deleted AccountSearchResult and TagSearchResult types and their re-exports.
Middleware & Routing
apps/web/src/middleware.ts, apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/redditbot/route.ts
Expanded social-bot user-agent regex to detect many bots; route now uses prefetchQuery(...) wrapper when fetching entry cache.
Metadata & Changelogs
packages/sdk/CHANGELOG.md, packages/wallets/CHANGELOG.md, packages/sdk/package.json, packages/wallets/package.json
Bumped package versions (sdk 2.0.26→2.0.27, wallets 1.5.52→1.5.53) and added changelog entries noting search-related updates and dependency bump.

Sequence Diagram(s)

sequenceDiagram
  participant UI as Client UI
  participant SDK as App SDK
  participant Hive as CONFIG.hiveClient
  participant Bridge as getProfiles

  rect rgba(200,200,255,0.5)
  UI->>SDK: request account search (q, limit)
  SDK->>Hive: database.call("lookup_accounts",[normalized, limit])
  Hive-->>SDK: usernames[]
  SDK->>Bridge: getProfiles(usernames)
  Bridge-->>SDK: Profile[]
  SDK-->>UI: Profiles (UI reads metadata.profile.name/about)
  end

  rect rgba(200,255,200,0.5)
  UI->>SDK: request topic search (q, limit)
  SDK->>Hive: database.call("get_trending_tags",[normalized, limit+1])
  Hive-->>SDK: TrendingTag[]
  SDK-->>UI: string[] filtered tags
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 I hopped from endpoints to Hive today,
Nested names and bios now lead the way,
Tags trimmed and keys tightened just right,
Bots spotted earlier in the night,
Hooray — search found a cozier light! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Search improvements' is vague and generic, using a non-descriptive term that doesn't convey specific information about the substantial changes in the changeset. Consider using a more specific title that reflects the main architectural change, such as 'Migrate search API to hive client calls' or 'Refactor search modules to use hive client lookups'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch search
📝 Coding Plan
  • Generate coding plan for human review comments

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.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Mar 14, 2026
@feruzm feruzm merged commit c05edad into develop Mar 14, 2026
1 check was pending
@feruzm feruzm deleted the search branch March 14, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant