refactor(ui): remove dead Activity Timeline and observation UI#205
Conversation
…ents Delete 18 files referencing dropped v5 tables (observations, user_prompts, session_summaries): FilterTabs, Timeline, ObservationCard, PromptCard, SummaryCard, ScoreBreakdown, RelationGraph, TagEditor, ObservationEditor, SearchResults, useTimeline, useTypes, useGraphMetrics, and 5 type definition files (observation, prompt, summary, relation, search). Clean HomeView to stats-only, remove Observations card from StatsCards (replaced with Connected Clients), remove Observations row from sidebar, strip dead functions/types from api.ts and types/api.ts, remove vis-network dependency. vue-tsc + vite build clean. -2776 lines.
WalkthroughУдалены множество UI-компонентов и связанных с ними типов/composables (Timeline, FilterTabs, карточки Observation/Prompt/Summary, RelationGraph, ScoreBreakdown, редакторы/TagEditor, SearchResults), удалены типы и API-утилиты для этих сущностей; StatsCards и AppSidebar обновлены; удалена зависимость Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Code Review
This pull request performs a significant cleanup of the UI by removing the Observations, Prompts, Summaries, and Timeline features. It deletes numerous components, composables, and types associated with these features, while also removing the vis-network dependency. Feedback was provided regarding the use of unknown[] in the API utility file, suggesting that these functions should either be updated with specific types or removed if they are now dead code.
…tchPatternObservations
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui/src/components/StatsCards.vue (1)
44-49:⚠️ Potential issue | 🟡 MinorНе показывайте
activeSessionsпод меткой “Sessions Today”.На Line 49 fallback на
stats?.activeSessionsделает метрику семантически неверной и может расходиться сui/src/components/layout/AppSidebar.vue:147, где для того же показателя используется толькоsessionsToday. Если поле ещё не пришло, лучше показать0или-, чем другое число под тем же названием.Предлагаемая правка
- <p class="text-2xl font-bold text-blue-400">{{ stats?.sessionsToday ?? stats?.activeSessions ?? 0 }}</p> + <p class="text-2xl font-bold text-blue-400">{{ stats?.sessionsToday ?? 0 }}</p>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ui/src/components/StatsCards.vue` around lines 44 - 49, В компоненте StatsCards.vue исправьте некорректный fallback: вместо вывода stats?.activeSessions под заголовком "Sessions Today" используйте только stats?.sessionsToday и дефолт (например 0 или "-"); найдите привязку, где сейчас используется выражение stats?.sessionsToday ?? stats?.activeSessions ?? 0 и замените его на stats?.sessionsToday ?? 0 (или stats?.sessionsToday ?? "-") чтобы под меткой отображалось только корректное поле sessionsToday.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ui/src/utils/api.ts`:
- Around line 461-470: В функции fetchSearchMisses замените замену
отсутствующего поля project на пустую строку: при маппинге (в переменной s) не
подставляйте '' в поле project, а присваивайте s.project как есть, чтобы
сохранить семантику optional-поля SearchMiss.project (т.е. оставить undefined
если проект отсутствует); обновите маппинг возвращаемого объекта в
fetchSearchMisses соответственно.
---
Outside diff comments:
In `@ui/src/components/StatsCards.vue`:
- Around line 44-49: В компоненте StatsCards.vue исправьте некорректный
fallback: вместо вывода stats?.activeSessions под заголовком "Sessions Today"
используйте только stats?.sessionsToday и дефолт (например 0 или "-"); найдите
привязку, где сейчас используется выражение stats?.sessionsToday ??
stats?.activeSessions ?? 0 и замените его на stats?.sessionsToday ?? 0 (или
stats?.sessionsToday ?? "-") чтобы под меткой отображалось только корректное
поле sessionsToday.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f793139b-9c5b-41aa-825f-c2e6903c1033
📒 Files selected for processing (27)
ui/package.jsonui/src/components/FilterTabs.vueui/src/components/ObservationCard.vueui/src/components/PromptCard.vueui/src/components/RelationGraph.vueui/src/components/ScoreBreakdown.vueui/src/components/StatsCards.vueui/src/components/SummaryCard.vueui/src/components/Timeline.vueui/src/components/index.tsui/src/components/layout/AppSidebar.vueui/src/components/observation/ObservationEditor.vueui/src/components/observation/TagEditor.vueui/src/components/search/SearchResults.vueui/src/composables/index.tsui/src/composables/useGraphMetrics.tsui/src/composables/useTimeline.tsui/src/composables/useTypes.tsui/src/types/api.tsui/src/types/index.tsui/src/types/observation.tsui/src/types/prompt.tsui/src/types/relation.tsui/src/types/search.tsui/src/types/summary.tsui/src/utils/api.tsui/src/views/HomeView.vue
💤 Files with no reviewable changes (22)
- ui/package.json
- ui/src/components/index.ts
- ui/src/types/summary.ts
- ui/src/components/SummaryCard.vue
- ui/src/components/FilterTabs.vue
- ui/src/composables/index.ts
- ui/src/components/Timeline.vue
- ui/src/types/search.ts
- ui/src/components/ScoreBreakdown.vue
- ui/src/types/index.ts
- ui/src/composables/useTypes.ts
- ui/src/composables/useGraphMetrics.ts
- ui/src/components/PromptCard.vue
- ui/src/components/observation/TagEditor.vue
- ui/src/components/search/SearchResults.vue
- ui/src/types/observation.ts
- ui/src/types/relation.ts
- ui/src/components/RelationGraph.vue
- ui/src/components/ObservationCard.vue
- ui/src/composables/useTimeline.ts
- ui/src/components/observation/ObservationEditor.vue
- ui/src/types/prompt.ts
| export async function fetchSearchMisses(signal?: AbortSignal): Promise<SearchMiss[]> { | ||
| const result = await postJson<{ miss_stats: Array<{ query: string; miss_count: number; last_seen: string; project?: string }> }>( | ||
| `${API_BASE}/analytics/search-misses`, {}, { signal } | ||
| ) | ||
| return (result?.miss_stats || []).map(s => ({ | ||
| query: s.query, | ||
| project: s.project || '', | ||
| frequency: s.miss_count, | ||
| last_seen: s.last_seen, | ||
| })) |
There was a problem hiding this comment.
Не подменяйте отсутствие project пустой строкой.
На Line 467 optional-поле превращается в '', хотя SearchMiss.project уже описан как project?: string. Это стирает семантику “проекта нет” и может дать пустые подписи или некорректные фильтры в UI.
Предлагаемая правка
return (result?.miss_stats || []).map(s => ({
query: s.query,
- project: s.project || '',
+ project: s.project,
frequency: s.miss_count,
last_seen: s.last_seen,
}))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ui/src/utils/api.ts` around lines 461 - 470, В функции fetchSearchMisses
замените замену отсутствующего поля project на пустую строку: при маппинге (в
переменной s) не подставляйте '' в поле project, а присваивайте s.project как
есть, чтобы сохранить семантику optional-поля SearchMiss.project (т.е. оставить
undefined если проект отсутствует); обновите маппинг возвращаемого объекта в
fetchSearchMisses соответственно.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
ui/src/utils/api.ts (1)
452-461:⚠️ Potential issue | 🟡 MinorСохраните
projectкак optional-поле.На Line 458 отсутствие
projectподменяется на'', хотяSearchMiss.projectуже описан как optional. Это стирает семантику “проекта нет” и может дать пустые подписи или некорректные фильтры в UI.Предлагаемая правка
return (result?.miss_stats || []).map(s => ({ query: s.query, - project: s.project || '', + project: s.project, frequency: s.miss_count, last_seen: s.last_seen, }))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ui/src/utils/api.ts` around lines 452 - 461, The mapping in fetchSearchMisses currently coerces project to an empty string (project: s.project || ''), losing the optional semantics of SearchMiss.project; update the map to preserve undefined by assigning project: s.project (or explicitly project: s.project ?? undefined) so the returned SearchMiss keeps project optional, and confirm the SearchMiss type still declares project as optional; adjust the mapping in fetchSearchMisses accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ui/src/utils/api.ts`:
- Around line 357-366: Функция cleanupPatterns использует postJson (который по
умолчанию ретраит до 3 раз), что недопустимо для небезопасной операции (dryRun:
false); исправьте вызов в cleanupPatterns так, чтобы POST к
`${API_BASE}/maintenance/patterns/cleanup` выполнялся без повторов — либо
передайте в postJson явную опцию отключающую ретраи (например retry: 0) либо
замените вызов на прямой fetch/axios без автоматических повторов; ссылайтесь на
функцию cleanupPatterns и на утилиту postJson при внесении правки.
---
Duplicate comments:
In `@ui/src/utils/api.ts`:
- Around line 452-461: The mapping in fetchSearchMisses currently coerces
project to an empty string (project: s.project || ''), losing the optional
semantics of SearchMiss.project; update the map to preserve undefined by
assigning project: s.project (or explicitly project: s.project ?? undefined) so
the returned SearchMiss keeps project optional, and confirm the SearchMiss type
still declares project as optional; adjust the mapping in fetchSearchMisses
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 49d2e45a-7691-40e4-930a-99a7cfd282f3
📒 Files selected for processing (1)
ui/src/utils/api.ts
| export async function cleanupPatterns( | ||
| threshold: number, | ||
| dryRun: boolean, | ||
| signal?: AbortSignal | ||
| ): Promise<PatternCleanupResult> { | ||
| return postJson<PatternCleanupResult>( | ||
| `${API_BASE}/maintenance/patterns/cleanup`, | ||
| { confidence_threshold: threshold, dry_run: dryRun }, | ||
| { signal } | ||
| ) |
There was a problem hiding this comment.
Не ретрайте cleanupPatterns без идемпотентности.
На Lines 357-366 этот maintenance-POST идет через postJson(), а тот по умолчанию повторяет запрос до 3 раз. Для dryRun: false это опасно: если первый cleanup выполнился на сервере, а клиент получил timeout/сетевую ошибку, повтор может повторно архивировать паттерны или ещё раз пересчитать confidence.
Предлагаемая правка
export async function cleanupPatterns(
threshold: number,
dryRun: boolean,
signal?: AbortSignal
): Promise<PatternCleanupResult> {
+ const retries = dryRun ? MAX_RETRIES : 1
return postJson<PatternCleanupResult>(
`${API_BASE}/maintenance/patterns/cleanup`,
{ confidence_threshold: threshold, dry_run: dryRun },
- { signal }
+ { signal, retries }
)
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ui/src/utils/api.ts` around lines 357 - 366, Функция cleanupPatterns
использует postJson (который по умолчанию ретраит до 3 раз), что недопустимо для
небезопасной операции (dryRun: false); исправьте вызов в cleanupPatterns так,
чтобы POST к `${API_BASE}/maintenance/patterns/cleanup` выполнялся без повторов
— либо передайте в postJson явную опцию отключающую ретраи (например retry: 0)
либо замените вызов на прямой fetch/axios без автоматических повторов;
ссылайтесь на функцию cleanupPatterns и на утилиту postJson при внесении правки.
Bump daemon version v5.0.0 → v5.1.0, plugin 5.0.1 → 5.1.0. Since v5.0.1: - PR #202: dead-code sweep — removed Go references to dropped tables (-2861 lines) - PR #203: env var cleanup, auth-skip-local, dead features removal (-5862 lines) - PR #204: dead UI views and API functions removal (-4065 lines) - PR #205: Activity Timeline + observation UI cleanup (-2784 lines) Total: ~15,500 lines of dead code removed post-v5.0.0.
Summary
Full cleanup of dead dashboard UI that referenced dropped v5 tables (observations, user_prompts, session_summaries).
Deleted 18 files (-2776 lines):
Edited 8 files:
Verification: vue-tsc clean, vite build clean.
Convention: C1-C7 per plan.md cross-phase conventions.
Summary by CodeRabbit
Удаления функциональности
Обновления
Chores