feat: paginate and search brand questions across selects
Frontend CI / Frontend (push) Successful in 3m19s
Backend CI / Backend (push) Successful in 14m30s

Make GET /api/tenant/brands/:id/questions return a paginated
QuestionListResponse (items/total/page/page_size) with optional `q`
full-text filter, validated page/page_size query params, and per-params
cache keys. Add a usePaginatedBrandQuestions composable backing the
imitation, template-wizard, and tracking question selects with
search-as-you-type and infinite scroll, plus ensure-loaded-by-id so a
deep-linked or pre-selected question is fetched even when off the first
page. Brands view now drives its questions table via server pagination.

Also redesign the Tracking hot-questions and cited-articles lists
(mention-rate badges/bars, metric groups, refreshed styling) and fall
back to citation-fact article_id/title when no high-confidence URL alias
matches, so cited articles surface even without an alias row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 22:01:23 +08:00
parent 184ebfc4c2
commit 9ed857e159
13 changed files with 1030 additions and 189 deletions
+7 -3
View File
@@ -124,6 +124,7 @@ import type {
QuestionCombinationFillResult,
QuestionCombinationRequest,
QuestionDistillRequest,
QuestionListResponse,
QuestionRequest,
QuotaSummary,
RecentArticle,
@@ -1139,9 +1140,12 @@ export const brandsApi = {
removeKeyword(brandId: number, keywordId: number) {
return apiClient.remove<null>(`/api/tenant/brands/${brandId}/keywords/${keywordId}`)
},
listQuestions(brandId: number, keywordId?: number | null) {
return apiClient.get<Question[]>(`/api/tenant/brands/${brandId}/questions`, {
params: keywordId ? { keyword_id: keywordId } : undefined,
listQuestions(
brandId: number,
params?: { keyword_id?: number | null; page?: number; page_size?: number; q?: string },
) {
return apiClient.get<QuestionListResponse>(`/api/tenant/brands/${brandId}/questions`, {
params,
})
},
previewQuestionCombination(brandId: number, payload: QuestionCombinationRequest) {