refactor(selection): replace concept sector filter with sub-industry

- pin the selection sector vocabulary to industry: the /sectors endpoint
  no longer accepts sector_type, and the port, adapter, and use case all
  resolve counts and member codes with sector_type="industry"
- relabel the results filter to 细分行业 and drop concept-type plumbing
  from the frontend API, query keys, and types
- show only 细分行业 in the signal detail panel; remove the concept-board
  chips and keep the snapshot-date tooltip on the industry line
- update backend and frontend tests to the industry vocabulary and record
  the revised scope in the task PRD
This commit is contained in:
yuxuanhui
2026-09-05 21:04:00 +08:00
parent ade1713e86
commit 68282f5d46
14 changed files with 82 additions and 179 deletions
@@ -71,12 +71,10 @@ function buildSelectionQueryParams(query: SelectionResultsQuery) {
export function getSelectionResultSectors(
strategy: SelectionStrategy,
targetTradeDate?: string,
sectorType: "concept" | "industry" = "concept",
signal?: AbortSignal,
) {
const params = new URLSearchParams({
strategy,
sector_type: sectorType,
})
if (targetTradeDate) params.set("target_trade_date", targetTradeDate)
return requestJson<SelectionSectors>(
@@ -78,8 +78,7 @@ export const selectionRunQueryKey = (
export const selectionSectorsQueryKey = (
strategy: SelectionStrategy,
targetTradeDate?: string,
sectorType: "concept" | "industry" = "concept",
) => ["selection", "sectors", strategy, targetTradeDate, sectorType] as const
) => ["selection", "sectors", strategy, targetTradeDate] as const
export function flattenSelectionResults(
data: InfiniteData<SelectionResults> | undefined,
@@ -133,12 +132,11 @@ export function useSelectionChart(
export function useSelectionResultSectors(
strategy: SelectionStrategy,
targetTradeDate?: string,
sectorType: "concept" | "industry" = "concept",
) {
return useQuery<SelectionSectors, Error>({
queryFn: ({ signal }) =>
getSelectionResultSectors(strategy, targetTradeDate, sectorType, signal),
queryKey: selectionSectorsQueryKey(strategy, targetTradeDate, sectorType),
getSelectionResultSectors(strategy, targetTradeDate, signal),
queryKey: selectionSectorsQueryKey(strategy, targetTradeDate),
})
}
@@ -28,9 +28,7 @@ export interface SelectionResultsQuery {
sector?: string
}
export type SelectionSectorType = "concept" | "industry"
export const selectionSectorTypes = ["concept", "industry"] as const
export type SelectionSectorType = "industry"
export interface SelectionSectorAggregate {
sector_code: string