fix: pre-launch UI hardening + KOL reduce-action type, proxy IP relay, settings redesign

Frontend half of the pre-launch audit campaign:

- types/index.ts + kol/KolPageClient.tsx: add missing 'reduce' KolAction
  (backend emits it; frontend lacked the type + color/label maps → undefined
  styling). Adds ACTION_COLOR/actionLabel/postActionLabel entries.
- proxy/[...path]/route.ts: relay real client IP (x-forwarded-for / x-real-ip)
  so the backend rate limiter buckets per-user instead of per-Next-server (BUG-02).
- Settings/BotConfigPanel redesign, paper-mode clarity, copy cleanup.
- Assorted page/display fixes, loading states, Pagination component.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
k
2026-05-29 11:57:43 +08:00
parent b76de36af0
commit d50c05b120
32 changed files with 1003 additions and 224 deletions
+5 -3
View File
@@ -9,7 +9,9 @@ interface DashboardState {
botReadiness: 'unknown' | 'saved' | 'verified' | 'ready'
hlApiKeySet: boolean // true if user already has a key saved in backend
hlApiKeyMasked: string | null // e.g. "...a1b2c3" shown after successful save
livePrices: { BTC: number | null; ETH: number | null }
// BUG-08 fix: backend now streams SOL/TRUMP/BNB/etc. — use an open Record
// so any asset tick can be stored, not just BTC/ETH.
livePrices: Record<string, number | null>
setSelectedPost: (id: number | null) => void
setAsset: (asset: 'BTC' | 'ETH') => void
setTimeframe: (tf: '5m' | '15m' | '1H' | '4H' | '1D' | '1W') => void
@@ -17,7 +19,7 @@ interface DashboardState {
setSubscribed: (subscribed: boolean) => void
setBotReadiness: (state: DashboardState['botReadiness']) => void
setHlApiKeySet: (set: boolean, masked?: string) => void
setLivePrice: (asset: 'BTC' | 'ETH', price: number) => void
setLivePrice: (asset: string, price: number) => void
}
export const useDashboardStore = create<DashboardState>((set) => ({
@@ -29,7 +31,7 @@ export const useDashboardStore = create<DashboardState>((set) => ({
botReadiness: 'unknown',
hlApiKeySet: false,
hlApiKeyMasked: null,
livePrices: { BTC: null, ETH: null },
livePrices: { BTC: null, ETH: null, SOL: null, TRUMP: null },
setSelectedPost: (id) => set({ selectedPostId: id }),
setAsset: (asset) => set({ asset }),
setTimeframe: (timeframe) => set({ timeframe }),