Skip to content

Add AI Flow settings popup for web-only AI provider control#314

Merged
koala73 merged 3 commits into
mainfrom
claude/ai-analysis-settings-popup-Fpd6A
Feb 24, 2026
Merged

Add AI Flow settings popup for web-only AI provider control#314
koala73 merged 3 commits into
mainfrom
claude/ai-analysis-settings-popup-Fpd6A

Conversation

@koala73

@koala73 koala73 commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a web-only settings popup (gear icon) in the Insights panel header that allows users to toggle between Cloud AI (Groq/OpenRouter) and Browser-local AI models. The popup includes status indicators, warnings about browser model size (~250MB), and a CTA to download the desktop app for Ollama support. When no AI providers are enabled, the Insights panel displays a disabled state instead of attempting analysis.

Type of change

  • New feature
  • Refactor / code cleanup

Affected areas

  • AI Insights / World Brief
  • Config / Settings

Changes

New Files

  • src/components/AiFlowPopup.ts: Popup component with gear icon button, toggle switches for cloud/browser AI, status indicator, and Ollama CTA
  • src/services/ai-flow-settings.ts: Web-only localStorage-backed settings service for AI provider preferences with change subscription support

Modified Files

  • src/components/InsightsPanel.ts:

    • Integrates AiFlowPopup (web-only, hidden on desktop/mobile)
    • Checks isAnyAiProviderEnabled() before rendering insights
    • Renders disabled state UI when no providers are active
    • Passes SummarizeOptions to control which AI providers are used
    • Stores last clusters for potential re-analysis on settings change
  • src/services/summarization.ts:

    • Adds SummarizeOptions interface with skipCloudProviders and skipBrowserFallback flags
    • Respects these flags in generateSummaryInternal() to skip disabled providers
  • src/styles/main.css:

    • Comprehensive styling for popup wrapper, gear button, dropdown, toggles, status indicators, and disabled state UI
    • Dark theme with accent colors for active/warning states
  • Locale files (all 13 languages): Added translation keys for popup labels, descriptions, warnings, status messages, and disabled state text

  • src/App.ts: Minor cleanup of unused variable reference

Design Notes

  • Web-only: Popup only appears on web (hidden on Tauri desktop where settings window handles AI config, and on mobile)
  • Persistent: Settings stored in localStorage with sensible defaults (cloud enabled, browser disabled)
  • Status feedback: Real-time status dot and text showing which providers are active
  • Graceful degradation: If no providers enabled, shows friendly disabled state with hint to enable via gear icon
  • Accessibility: Proper ARIA labels, keyboard support (Escape to close), outside-click dismissal

Checklist

  • Tested on worldmonitor.app variant
  • TypeScript compiles without errors
  • No API keys or secrets committed
  • Translations added for all supported languages

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF

Add a gear icon to the AI Insights panel header that opens a settings
popup giving web users explicit control over the AI analysis pipeline.
Users can now toggle cloud AI (Groq/OpenRouter) and browser local model
independently, with a static CTA for Ollama desktop support.

- New ai-flow-settings.ts state layer with localStorage persistence
- SummarizeOptions param added to generateSummary() (backward-compatible)
- InsightsPanel: gear icon, disabled state, generation token for races
- AiFlowPopup: toggles, 250MB warning, status footer, Ollama CTA
- Remove mlWorker.isAvailable gate in App.ts for cloud-only mode
- CSS: popup, toggles, status indicators, disabled state
- i18n: 16 new keys across all 17 locale files with translations

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF
- Reset cachedBrief and lastBriefUpdate in onAiFlowChanged() so new
  provider settings take effect immediately instead of being blocked
  by the 2-minute cooldown with a stale (possibly null) cached brief
- Remove unused isAnyAiProviderEnabled() import and dead `void any`
  in AiFlowPopup.updateStatus()

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF
@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Feb 24, 2026 11:28am
worldmonitor-finance Ready Ready Preview, Comment Feb 24, 2026 11:28am
worldmonitor-happy Ready Ready Preview, Comment Feb 24, 2026 11:28am
worldmonitor-startup Ready Ready Preview, Comment Feb 24, 2026 11:28am

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@koala73
koala73 merged commit 13e4dd0 into main Feb 24, 2026
5 checks passed
koala73 added a commit that referenced this pull request Feb 24, 2026
## What's Changed

### Performance
- perf: defer YouTube/map init and stagger data loads to reduce blocking time (#287)

### Features
- feat: universal country detection — CII scoring for all countries (#344)
- feat: add Mexico as CII hotspot for cartel/security monitoring (#327)
- feat: add Mexico and LatAm security feeds for instability coverage (#325)
- feat: add category pills and search filter to Panels tab (#322)
- feat: consolidate settings into unified tabbed modal (#319)
- feat: add Island Times (Palau) RSS feed (#317)
- feat: add AI Flow settings popup for web-only AI provider control (#314)
- feat: optional channels with tab-based region browse UI (#295)
- feat: custom channel management (#282)
- feat: add Bild RSS feed scoped to German locale (#312)

### Bug Fixes
- fix: suppress notification sound when popup alerts are disabled
- fix: prevent entity conflation in pane summarization (#341)
- fix: add Mexico to COUNTRY_BOUNDS and COUNTRY_ALIASES (#338)
- fix: make OpenSky cache TTLs env-configurable (#333)
- fix: serialize OpenSky requests with global 429 cooldown (#332)
- fix: replace RSSHub feeds with native/Google News alternatives (#331)
- fix: OpenSky auth resilience — retry, IPv4, no negative cache on auth fail (#329)
- fix: add CARTO and OpenStreetMap attribution to map (#323)
- fix: add drag cleanup handlers and suppress click after drag-drop (#315)
- fix: replace HTML5 drag API with mouse events for WKWebView (#313)
- fix: open channel settings as inline modal instead of separate window (#311)
- fix: sync YouTube live panel mute state with native player controls (#285)
- fix: strip Ollama reasoning tokens from summaries (#299)
- fix: open external links in system browser on Tauri desktop (#297)
- fix: add User-Agent and Cloudflare 403 detection to secret validation (#296)
- fix: infra cost optimizations round 2 (#275)
- fix: enforce military bbox filtering (#284)
- fix: infrastructure cost optimizations across caching, polling, batching (#283)
- fix: circuit breaker persistent cache with safety fixes (#281)
- fix: immediately refresh stale services when tab regains focus (#277)

### Security
- Security hardening: SSRF protection, auth gating, and token generation (#343)
- Harden Railway relay auth, caching, and proxy routing (#320)
- Build/runtime hardening and dependency security updates (#286)
- fix: harden embed postMessage origin check (#302)
@koala73
koala73 deleted the claude/ai-analysis-settings-popup-Fpd6A branch February 25, 2026 07:59
andreteow pushed a commit to andreteow/worldmonitor-a47 that referenced this pull request Feb 25, 2026
)

* feat: add AI analysis settings popup to Insights panel (web-only)

Add a gear icon to the AI Insights panel header that opens a settings
popup giving web users explicit control over the AI analysis pipeline.
Users can now toggle cloud AI (Groq/OpenRouter) and browser local model
independently, with a static CTA for Ollama desktop support.

- New ai-flow-settings.ts state layer with localStorage persistence
- SummarizeOptions param added to generateSummary() (backward-compatible)
- InsightsPanel: gear icon, disabled state, generation token for races
- AiFlowPopup: toggles, 250MB warning, status footer, Ollama CTA
- Remove mlWorker.isAvailable gate in App.ts for cloud-only mode
- CSS: popup, toggles, status indicators, disabled state
- i18n: 16 new keys across all 17 locale files with translations

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF

* fix: reset brief cache on settings change, remove dead code in popup

- Reset cachedBrief and lastBriefUpdate in onAiFlowChanged() so new
  provider settings take effect immediately instead of being blocked
  by the 2-minute cooldown with a stale (possibly null) cached brief
- Remove unused isAnyAiProviderEnabled() import and dead `void any`
  in AiFlowPopup.updateStatus()

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF

* fix: invalidate insights brief cache on AI flow changes

---------

Co-authored-by: Claude <[email protected]>
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
)

* feat: add AI analysis settings popup to Insights panel (web-only)

Add a gear icon to the AI Insights panel header that opens a settings
popup giving web users explicit control over the AI analysis pipeline.
Users can now toggle cloud AI (Groq/OpenRouter) and browser local model
independently, with a static CTA for Ollama desktop support.

- New ai-flow-settings.ts state layer with localStorage persistence
- SummarizeOptions param added to generateSummary() (backward-compatible)
- InsightsPanel: gear icon, disabled state, generation token for races
- AiFlowPopup: toggles, 250MB warning, status footer, Ollama CTA
- Remove mlWorker.isAvailable gate in App.ts for cloud-only mode
- CSS: popup, toggles, status indicators, disabled state
- i18n: 16 new keys across all 17 locale files with translations

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF

* fix: reset brief cache on settings change, remove dead code in popup

- Reset cachedBrief and lastBriefUpdate in onAiFlowChanged() so new
  provider settings take effect immediately instead of being blocked
  by the 2-minute cooldown with a stale (possibly null) cached brief
- Remove unused isAnyAiProviderEnabled() import and dead `void any`
  in AiFlowPopup.updateStatus()

https://claude.ai/code/session_01AgLDUybKNri83vgZQNC3HF

* fix: invalidate insights brief cache on AI flow changes

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants