Skip to content

feat(friends): add searchable friend lists#75

Open
gushishang wants to merge 1 commit into
mainfrom
codex/add-friend-search-feature
Open

feat(friends): add searchable friend lists#75
gushishang wants to merge 1 commit into
mainfrom
codex/add-friend-search-feature

Conversation

@gushishang
Copy link
Copy Markdown
Member

Motivation

  • Provide a way to search/filter friends by nickname across all relation tabs (following, followers, volunteers, editors, retired, banned) so users can quickly find contacts.
  • Use backend filtering via the existing /Users/GetRelations API to keep list behavior consistent and paginated.

Description

  • Added a search input to the Friends page in src/views/Friends.vue (n-input bound to searchText) and a small .friends__search style block.
  • Passed the trimmed search text to each tab's UserList via a new :query prop (:query="searchText.trim()").
  • Updated src/components/friends/list.vue to accept query?: string, send Query: query || '' to getData('/Users/GetRelations', ...), and watch the query prop to reset pagination (items, skip, noMore, hasInformed) and reload results.
  • Added friends.searchPlaceholder translations to src/i18n/zh.ts, src/i18n/en.ts, src/i18n/de.ts, src/i18n/ja.ts, and src/i18n/fr.ts.

Testing

  • Ran npm run lint:i18n which passed (i18n check passed).
  • Ran npm run eslint which completed with warnings (existing repository complexity/line-count warnings) and no new errors were introduced.

Codex Task

@gushishang
Copy link
Copy Markdown
Member Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05cbdd455f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +100 to +104
items.value = []
skip.value = 0
noMore.value = false
hasInformed.value = false
void handleLoad()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Queue a reload when query changes mid-request

If the user updates the search text while a previous /Users/GetRelations request is still in flight, this watcher clears items and immediately calls handleLoad(), but handleLoad() exits early because loading.value is still true. When the old request finally resolves, it appends results for the stale query, and no request for the new query is guaranteed to run, so the list can show incorrect search results until another scroll/load event happens.

Useful? React with 👍 / 👎.

@gushishang
Copy link
Copy Markdown
Member Author

gushishang commented May 20, 2026 via email

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • npx eslint src/components/friends/list.vue (passes; existing complexity/line-count warnings only, no errors).

View task →

@gushishang
Copy link
Copy Markdown
Member Author

gushishang commented May 20, 2026 via email

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05cbdd455f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +100 to +104
items.value = []
skip.value = 0
noMore.value = false
hasInformed.value = false
void handleLoad()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Queue reload when query changes mid-request

When the search query changes while a /Users/GetRelations request is still in flight, this watcher clears items and immediately calls handleLoad(), but handleLoad() exits early because loading.value is still true. That means the new query is never fetched at that moment, and when the old request returns it can repopulate the list with stale results from the previous query. This is reproducible by typing quickly during loading and leaves the visible list inconsistent until another load is triggered.

Useful? React with 👍 / 👎.

@gushishang
Copy link
Copy Markdown
Member Author

gushishang commented May 20, 2026 via email

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.

1 participant