feat(monitors): upgrade monitors with rules, highlights, and editing#2398
feat(monitors): upgrade monitors with rules, highlights, and editing#2398
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR upgrades the Key findings:
Confidence Score: 4/5Hold for the three P1 issues — the empty-sources silent failure, ctx.newsByCategory inconsistency, and URL-in-haystack false positives — before merging. Three P1 findings exist: (1) a real data-correctness bug where a monitor with only pro-tier sources silently produces zero matches after a downgrade, (2) a state inconsistency that causes news highlights to disappear on re-render from stored category data, and (3) item.link in the keyword haystack generating false positive matches from URL slugs. All three affect the primary monitor-matching user path in ways users will notice. The rest of the feature is well-structured, has good migration logic, and is covered by tests. src/services/monitors.ts (prepareMonitorsForRuntime empty-sources fallback, matchesKeyword haystack composition) and src/app/data-loader.ts (ctx.newsByCategory not updated). Important Files Changed
Sequence DiagramsequenceDiagram
participant App as App.ts
participant DL as DataLoaderManager
participant MS as monitors.ts
participant MP as MonitorPanel
participant Ctx as AppContext
App->>MS: normalizeMonitors(loadFromStorage)
App->>Ctx: ctx.monitors = normalized
note over DL: On news refresh / monitor change
DL->>MS: applyMonitorHighlightsToNews(ctx.monitors, ctx.allNews)
MS-->>DL: highlightedAllNews
DL->>Ctx: ctx.allNews = highlightedAllNews
loop each category
DL->>MS: applyMonitorHighlightsToNews(monitors, items)
MS-->>DL: highlightedItems
DL->>DL: renderNewsForCategory(category, highlightedItems)
end
DL->>MP: renderResults({news, advisories, crossSourceSignals})
MP->>MS: evaluateMonitorMatches(monitors, feed)
MS-->>MP: MonitorMatch[]
MP->>MP: refreshResults()
note over MP: On breaking-news event
document-->>MP: wm:breaking-news CustomEvent
MP->>MP: breakingAlerts.unshift(detail), slice(0,50)
MP->>MS: evaluateMonitorMatches(monitors, feed + breakingAlerts)
MS-->>MP: MonitorMatch[]
MP->>MP: refreshResults()
|
| this.setComposerStatus(t('components.monitor.freeLimit', { count: String(FREE_MONITOR_LIMIT) }), 'info'); | ||
| } | ||
|
|
||
| private resetComposer(): void { | ||
| this.editingMonitorId = null; | ||
| if (this.nameInput) this.nameInput.value = ''; | ||
| if (this.includeInput) this.includeInput.value = ''; | ||
| if (this.excludeInput) this.excludeInput.value = ''; | ||
| if (this.modeSelect) this.modeSelect.value = 'any'; | ||
| for (const [source, input] of this.sourceInputs) { | ||
| input.checked = source === 'news' || source === 'breaking'; | ||
| } | ||
| if (this.addBtn) this.addBtn.textContent = t('components.monitor.add'); | ||
| if (this.cancelBtn) this.cancelBtn.style.display = 'none'; | ||
| } | ||
|
|
||
| private renderMonitorCard(monitor: Monitor): HTMLElement { |
There was a problem hiding this comment.
Free-limit status message shown to pro users
applyComposerAccessState() unconditionally calls setComposerStatus(t('components.monitor.freeLimit', ...)) at the end, regardless of whether the user has pro access. A pro user will see "Free: up to 3 monitors…" even though they have no limit and can use advanced features. The message should be suppressed (or replaced with a pro-context message) when proAccess === true.
if (!proAccess) {
this.setComposerStatus(
t('components.monitor.freeLimit', { count: String(FREE_MONITOR_LIMIT) }),
'info',
);
}|
like If u liked this idea I could work on it just waiting to know if I close or make the fixes. @koala73 |
|
@FayezBast — this is a valuable upgrade and we'd like to see it move forward. Three P1s from Greptile need fixing:
Also: cookie.includes(name) should split on '; ' and check for exact key name match. Once those are fixed this is ready to merge. Good work on the test coverage and migration logic! |
Summary
My Monitorsfrom basic keyword watchlists to richer monitor rulesType of change
Affected areas
Checklist
npm run typecheck)