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
+8 -2
View File
@@ -116,11 +116,17 @@ func brandQuestionsCachePrefix(tenantID, brandID int64) string {
return fmt.Sprintf("brand:questions:%d:%d:", tenantID, brandID)
}
func brandQuestionsCacheKey(tenantID, brandID int64, keywordID *int64) string {
func brandQuestionsCacheKey(tenantID, brandID int64, params QuestionListParams) string {
return fmt.Sprintf("%s%s", brandQuestionsCachePrefix(tenantID, brandID), digestCacheKey(struct {
KeywordID *int64 `json:"keyword_id,omitempty"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Query string `json:"q,omitempty"`
}{
KeywordID: keywordID,
KeywordID: params.KeywordID,
Page: params.Page,
PageSize: params.PageSize,
Query: params.Query,
}))
}