Skip to content

refactor(ui): remove dead Activity Timeline and observation UI#205

Merged
thebtf merged 2 commits into
mainfrom
refactor/dashboard-dead-ui-cleanup
Apr 24, 2026
Merged

refactor(ui): remove dead Activity Timeline and observation UI#205
thebtf merged 2 commits into
mainfrom
refactor/dashboard-dead-ui-cleanup

Conversation

@thebtf
Copy link
Copy Markdown
Owner

@thebtf thebtf commented Apr 24, 2026

Summary

Full cleanup of dead dashboard UI that referenced dropped v5 tables (observations, user_prompts, session_summaries).

Deleted 18 files (-2776 lines):

  • Components: FilterTabs, Timeline, ObservationCard, PromptCard, SummaryCard, ScoreBreakdown, RelationGraph, TagEditor, ObservationEditor, SearchResults
  • Composables: useTimeline, useTypes, useGraphMetrics
  • Types: observation.ts, prompt.ts, summary.ts, relation.ts, search.ts

Edited 8 files:

  • HomeView → stats-only (removed Activity Timeline section)
  • StatsCards → removed dead Observations card, added Connected Clients
  • AppSidebar → removed Observations row from sidebar
  • api.ts → removed ~20 dead API functions and interfaces
  • types/api.ts → removed dead feed types, GraphStats, VectorMetrics
  • Barrel exports cleaned (components, composables, types)
  • package.json → removed vis-network dependency

Verification: vue-tsc clean, vite build clean.

Convention: C1-C7 per plan.md cross-phase conventions.

Summary by CodeRabbit

  • Удаления функциональности

    • Удалены: шкала/лента с фильтрами, компоненты карточек (наблюдений, запросов, сводок), редакторы и тег-редактор, граф связей, подробный разбор оценок и результаты поиска; связанные типы и вспомогательные утилиты.
  • Обновления

    • Статистика и панели: «Наблюдения» заменено на «Подключённые», интерфейс боковой панели показывает «Активность / Сеансы сегодня».
  • Chores

    • Удалены неиспользуемые зависимости из пакета.

…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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Walkthrough

Удалены множество UI-компонентов и связанных с ними типов/composables (Timeline, FilterTabs, карточки Observation/Prompt/Summary, RelationGraph, ScoreBreakdown, редакторы/TagEditor, SearchResults), удалены типы и API-утилиты для этих сущностей; StatsCards и AppSidebar обновлены; удалена зависимость vis-network из ui/package.json.

Changes

Cohort / File(s) Summary
Удаление зависимостей
ui/package.json
Удалены зависимости vis-data и vis-network.
Карточки и списки / удалены
ui/src/components/FilterTabs.vue, ui/src/components/ObservationCard.vue, ui/src/components/PromptCard.vue, ui/src/components/SummaryCard.vue, ui/src/components/SearchResults.vue
Полное удаление компонентов, их пропсов/эмитов и соответствующей UI-логики.
Графы и модалки / удалены
ui/src/components/RelationGraph.vue, ui/src/components/ScoreBreakdown.vue
Удалены визуализация графа, связанные загрузки/обработчики событий и модальные представления деталей.
Редакторы и теги / удалены
ui/src/components/observation/ObservationEditor.vue, ui/src/components/observation/TagEditor.vue
Удалены компоненты редактирования наблюдений и управления тегами, включая их API-эмиты и локальное состояние.
Timeline / удалено
ui/src/components/Timeline.vue
Удалён компонент временной шкалы и логика выбора/рендеринга элементов feed.
Экспорт компонентов / обновлён
ui/src/components/index.ts
Удалены переэкспорты удалённых компонентов.
Статистика / обновлён
ui/src/components/StatsCards.vue
Удалён проп observationCount; карточка "Observations" заменена на "Connected" (connectedClients) и иконка обновлена.
Боковая панель / обновлён
ui/src/components/layout/AppSidebar.vue
Заменён блок "Memory" (observationCount) на "Activity" (sessionsToday).
Composables / удалены и обрезаны
ui/src/composables/useTimeline.ts, ui/src/composables/useGraphMetrics.ts, ui/src/composables/useTypes.ts, ui/src/composables/index.ts
Удалены composables для таймлайна, метрик графа и типов; убраны соответствующие реэкспорты.
Типы / удалены и изменены
ui/src/types/api.ts, ui/src/types/observation.ts, ui/src/types/prompt.ts, ui/src/types/relation.ts, ui/src/types/search.ts, ui/src/types/summary.ts, ui/src/types/index.ts
Удалены типы для feed-items, наблюдений, подсказок, отношений, поиска и сводок; из Stats убрано observationCount; ограничены типы событий SSE; удалены GraphStats/VectorMetrics; сокращены реэкспорты.
API утилиты / переработаны
ui/src/utils/api.ts
Удалены функции загрузки наблюдений/подсказок/сводок, графов отношений, скорингов, некоторых аналитик и управления тегами; переработана экспортная поверхность и типы результатов.
Главный вид / обновлён
ui/src/views/HomeView.vue
Удалена инициализация/рендер Timeline и FilterTabs; StatsCards вызывается без observation-count и useStats без currentProject.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

ai-review:active

🐰 Я кролик, я радуюсь ветру,
Где компоненты сгладил он в прах,
Графы улетели — тихо, без крика,
Код стал чище, светлей мокрых фраж.
Взмахнул я лапкой — миг обновленья!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Название точно отражает основную цель PR: удаление мёртвого кода UI компонентов Activity Timeline и наблюдений, что полностью соответствует содержимому changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/dashboard-dead-ui-cleanup

Comment @coderabbitai help to get the list of available commands and usage tips.

@thebtf
Copy link
Copy Markdown
Owner Author

thebtf commented Apr 24, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ui/src/utils/api.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c52a169 and d4e37e4.

📒 Files selected for processing (27)
  • ui/package.json
  • ui/src/components/FilterTabs.vue
  • ui/src/components/ObservationCard.vue
  • ui/src/components/PromptCard.vue
  • ui/src/components/RelationGraph.vue
  • ui/src/components/ScoreBreakdown.vue
  • ui/src/components/StatsCards.vue
  • ui/src/components/SummaryCard.vue
  • ui/src/components/Timeline.vue
  • ui/src/components/index.ts
  • ui/src/components/layout/AppSidebar.vue
  • ui/src/components/observation/ObservationEditor.vue
  • ui/src/components/observation/TagEditor.vue
  • ui/src/components/search/SearchResults.vue
  • ui/src/composables/index.ts
  • ui/src/composables/useGraphMetrics.ts
  • ui/src/composables/useTimeline.ts
  • ui/src/composables/useTypes.ts
  • ui/src/types/api.ts
  • ui/src/types/index.ts
  • ui/src/types/observation.ts
  • ui/src/types/prompt.ts
  • ui/src/types/relation.ts
  • ui/src/types/search.ts
  • ui/src/types/summary.ts
  • ui/src/utils/api.ts
  • ui/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

Comment thread ui/src/utils/api.ts
Comment on lines +461 to +470
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,
}))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Не подменяйте отсутствие 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 соответственно.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d4e37e4 and f65eed4.

📒 Files selected for processing (1)
  • ui/src/utils/api.ts

Comment thread ui/src/utils/api.ts
Comment on lines +357 to +366
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 }
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Не ретрайте 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 при внесении правки.

@thebtf thebtf merged commit 2fcf3b1 into main Apr 24, 2026
8 checks passed
@thebtf thebtf deleted the refactor/dashboard-dead-ui-cleanup branch April 24, 2026 22:23
thebtf added a commit that referenced this pull request Apr 24, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant