mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
* feat(frameworks): add settings section and import modal - Add Analysis Frameworks group to preferences-content.ts between Intelligence and Media sections - Per-panel active framework display (read-only, 4 panels) - Skill library list with built-in badge, Rename and Delete actions for imported frameworks - Import modal with two tabs: From agentskills.io (fetch + preview) and Paste JSON - All error cases handled inline: network, domain validation, missing instructions, invalid JSON, duplicate name, instructions too long, rate limit - Add api/skills/fetch-agentskills.ts edge function (proxy to agentskills.io) - Add analysis-framework-store.ts (loadFrameworkLibrary, saveImportedFramework, deleteImportedFramework, renameImportedFramework, getActiveFrameworkForPanel) - Add fw-* CSS classes to main.css matching dark panel aesthetic * feat(panels): wire analytical framework store into InsightsPanel, CountryDeepDive, DailyMarketBrief, DeductionPanel - InsightsPanel: append active framework to geoContext in updateFromClient(); subscribe in constructor, unsubscribe in destroy() - CountryIntelManager: pass framework as query param to fetchCountryIntelBrief(); subscribe to re-open brief on framework change; unsubscribe in destroy() - DataLoaderManager: add dailyBriefGeneration counter for stale-result guard; pass frameworkAppend to buildDailyMarketBrief(); subscribe to framework changes to force refresh; unsubscribe in destroy() - daily-market-brief service: add frameworkAppend? field to BuildDailyMarketBriefOptions; append to extendedContext before summarize call - DeductionPanel: append active framework to geoContext in handleSubmit() before RPC call * feat(frameworks): add FrameworkSelector UI component - Create FrameworkSelector component with premium/locked states - Premium: select dropdown with all framework options, change triggers setActiveFrameworkForPanel - Locked: disabled select + PRO badge, click calls showGatedCta(FREE_TIER) - InsightsPanel: adds asterisk note (client-generated analysis hint) - Wire into InsightsPanel, DailyMarketBriefPanel, DeductionPanel (via this.header) - Wire into CountryDeepDivePanel header right-side (no Panel base, panel=null) - Add framework-selector CSS to main.css * fix(frameworks): make new proto fields optional in generated types * fix(frameworks): extract firstMsg to satisfy strict null checks in tsconfig.api.json * fix(docs): add blank lines around lists/headings to pass markdownlint * fix(frameworks): add required proto string fields to call sites after make generate * chore(review): add code review todos 041-057 for PR #2380 7 review agents (TypeScript, Security, Architecture, Performance, Simplicity, Agent-Native, Learnings) identified 17 findings across 5 P1, 8 P2, and 4 P3 categories.
1.4 KiB
1.4 KiB
status, priority, issue_id, tags, dependencies
| status | priority | issue_id | tags | dependencies | |||
|---|---|---|---|---|---|---|---|
| pending | p3 | 057 |
|
Date.now() IDs for imported frameworks can collide — use crypto.randomUUID() instead
Problem Statement
preferences-content.ts uses Date.now() as the id for newly imported frameworks. If a user imports two frameworks within the same millisecond (e.g., via automated paste), both get the same ID, causing a silent duplicate that saveImportedFramework may not catch (its duplicate check is on name, not id). crypto.randomUUID() is available in all modern browsers and provides guaranteed uniqueness.
Findings
src/services/preferences-content.ts— import handler:id: Date.now().toString()(approximate location)saveImportedFrameworkinanalysis-framework-store.tschecks for duplicate names but not duplicate IDs- Flagged by: kieran-typescript-reviewer
Proposed Solutions
Option A: Use crypto.randomUUID() (Recommended)
id: crypto.randomUUID()
Available globally in all browser targets and Vercel Edge runtime. Effort: Trivial | Risk: Low
Technical Details
- File:
src/services/preferences-content.ts - PR: koala73/worldmonitor#2380
Acceptance Criteria
- Framework
idusescrypto.randomUUID()instead ofDate.now() - Two simultaneous imports produce distinct IDs
Work Log
- 2026-03-27: Identified during PR #2380 review by kieran-typescript-reviewer