Skip to content

chore(chat-ui,chat-legacy,trpc,db,desktop,mobile): delete orphan packages and the device-presence system - #6435

Merged
saddlepaddle merged 2 commits into
mainfrom
teardown/orphan-packages
Aug 13, 2026
Merged

saddlepaddle merged 2 commits into
mainfrom
teardown/orphan-packages

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Teardown Wave A, slice 3

Deletes orphan packages and the entire device-presence system. Every claim re-verified by grep before deletion.

Removed

  • packages/chat-ui/ entirely (42 files, Lexical-based) — zero importers repo-wide; the only references were two storybook config lines in packages/ui (stories glob + a @source in storybook.css), both cleaned up
  • packages/chat-legacy/src/server/hono/ (createChatRuntimeHonoApp, zero importers) plus its now-orphaned hono dep and ./server/hono export. The rest of chat-legacy stays — ChatService provider auth, AI naming, and slash commands are a separate later effort
  • The whole device-presence system: the desktop + mobile useDevicePresence hooks, the device router (registerDevice was its only procedure; those hooks its only callers), and the device_presence table itself (migration 0068) plus the device_type enum and the electric-proxy allowlist arm

Why the table can drop now, unlike the rest of Wave B: it has zero readers, and its Electric collection was removed long ago (b1d3f3923) — so no shipped client subscribes to its shape. Verified against the desktop-v1.20.2 bundle, which syncs only tasks, task_statuses, projects, v2_hosts, v2_clients, v2_users_hosts, v2_workspaces, workspaces, auth.members. Those tables stay gated: ~4,900 weekly users are still on pre-1.20 builds and dropping a subscribed shape would kill their sync stream.

Behavior change for old clients (silent): they'll call the removed device.registerDevice and get a tRPC NOT_FOUND on a fire-and-forget upsert whose result nothing reads. No crash path, no user-visible error.

Kept deliberately: AgentHooks and the mobile authenticated layout (both still do other work); expo-constants in mobile (a real transitive native module of expo/expo-router — sherif agrees).

Verification: lint exit 0 · typecheck exit 0 (37/37) · sherif exit 0 · db 13/13 · chat-legacy 130/130 · desktop 2687/2687 · mobile pass-with-no-tests. Leftover greps for createChatRuntimeHonoApp/useDevicePresence/registerDevice/devicePresence: zero hits repo-wide.

Follows #6431 and #6434 in the Sandbox Workspaces cleanup track.

Summary by CodeRabbit

  • Removed Features

    • Retired the legacy chat composer and related capabilities, including attachments, mentions, commands, dictation, drag-and-drop, and scroll-to-bottom controls.
    • Device presence registration and status tracking are no longer available in desktop or mobile apps.
    • Removed the legacy chat server endpoint and device presence service.
  • Maintenance

    • Updated component previews and documentation tooling to reflect retired chat experiences.

…s and device-presence writers

Teardown Wave A slice 3.

- packages/chat-ui: deleted entirely (42 files, Lexical-based) — zero importers; only references were two storybook config lines in packages/ui
- packages/chat-legacy/src/server/hono: deleted (createChatRuntimeHonoApp had zero importers) + its now-orphaned hono dep and export entry. Rest of chat-legacy stays
- device_presence writers: deleted the desktop + mobile useDevicePresence hooks and the device router (registerDevice was its only procedure and those hooks its only callers). The device_presence TABLE stays for Wave B, gated on v1 population drain

AgentHooks and the mobile authenticated layout are kept — both still do other work.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cfda2620-4b14-4b23-a13a-df28029fbd29

📥 Commits

Reviewing files that changed from the base of the PR and between e659071 and aed2a9d.

📒 Files selected for processing (7)
  • apps/electric-proxy/src/where.ts
  • packages/db/drizzle/0068_drop_device_presence.sql
  • packages/db/drizzle/meta/0068_snapshot.json
  • packages/db/drizzle/meta/_journal.json
  • packages/db/src/schema/enums.ts
  • packages/db/src/schema/relations.ts
  • packages/db/src/schema/schema.ts
💤 Files with no reviewable changes (4)
  • packages/db/src/schema/enums.ts
  • apps/electric-proxy/src/where.ts
  • packages/db/src/schema/relations.ts
  • packages/db/src/schema/schema.ts

📝 Walkthrough

Walkthrough

This change removes device presence hooks, the v1 device router, and the device presence database schema. It also deletes the legacy Hono chat runtime, the packages/chat-ui package and components, and related Storybook configuration.

Changes

Device presence retirement

Layer / File(s) Summary
Remove device presence integrations
apps/desktop/.../AgentHooks/*, apps/mobile/app/(authenticated)/_layout.tsx, apps/desktop/.../useDevicePresence/*, apps/mobile/hooks/useDevicePresence/*
Desktop and mobile authenticated layouts no longer invoke useDevicePresence. The hook implementations and re-exports are deleted.
Remove device presence routing and schema
packages/trpc/src/root.ts, packages/trpc/src/router/device/*, apps/electric-proxy/src/where.ts, packages/db/src/schema/*, packages/db/drizzle/*
The deviceRouter, device-presence proxy filtering, database table, relations, device type declarations, and related migration metadata are removed. The migration drops the table and PostgreSQL type.

Legacy chat surface removal

Layer / File(s) Summary
Remove legacy Hono runtime
packages/chat-legacy/package.json, packages/chat-legacy/src/server/hono/*
The Hono server export, dependency, application factory, and re-export are deleted.
Delete chat UI package and components
packages/chat-ui/package.json, packages/chat-ui/src/components/*, packages/chat-ui/src/types/*, packages/chat-ui/tsconfig.json
The packages/chat-ui package and its prompt-input, attachment, dictation, mention, command, Lexical, scroll-button, type, style, and configuration files are deleted.
Remove Storybook discovery
packages/ui/.storybook/main.ts, packages/ui/.storybook/storybook.css
Storybook no longer discovers stories or CSS sources from packages/chat-ui.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to aed2a

This PR removes unused packages, dead server paths, and device-presence writers while retaining the table for later cleanup; the reported checks pass, and no actionable merge-blocking risk remains.

Possibly related PRs

Suggested reviewers: kitenite

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly summarizes the removal of orphan packages and the device-presence system in conventional commit format.
Description check ✅ Passed The description explains the changes, rationale, behavior impact, retained components, and verification results, but does not include the template checklist.
✨ 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 teardown/orphan-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Zero readers repo-wide; its Electric collection was removed long ago (b1d3f39), so no shipped client subscribes to the device_presence shape — verified against the desktop-v1.20.2 bundle, which syncs tasks/task_statuses/projects/v2_hosts/v2_clients/v2_users_hosts/v2_workspaces/workspaces/auth.members only. Its writers go in the same PR; old clients calling the removed device.registerDevice get a NOT_FOUND on a fire-and-forget upsert nothing reads.

Unlike the other Wave B tables, this one needs no adoption gate. Drops the device_type enum and the electric-proxy allowlist arm with it.
@saddlepaddle saddlepaddle changed the title chore(chat-ui,chat-legacy,trpc,desktop,mobile): delete orphan packages and device-presence writers chore(chat-ui,chat-legacy,trpc,db,desktop,mobile): delete orphan packages and the device-presence system Aug 13, 2026
@saddlepaddle
saddlepaddle merged commit f48cd8a into main Aug 13, 2026
19 checks passed
@saddlepaddle
saddlepaddle deleted the teardown/orphan-packages branch August 13, 2026 19:13
saddlepaddle added a commit that referenced this pull request Aug 14, 2026
chat-ui was deleted as an orphan on the evidence that nothing imported it. That was the wrong test: it depends on @superset/chat, the chat-v3 protocol package, so it is the in-progress UI layer for chat-v3 rather than debris. Zero importers is what unfinished work looks like too.

Restores all 40 files (PromptInput, ComposerDropZone, ScrollToBottomButton and their shared components) plus the two storybook wiring lines in packages/ui.
@Kitenite Kitenite mentioned this pull request Aug 16, 2026
3 tasks done

This branch was previously deployed

1 inactive deployment
preview — aed2a9d7 Deployed Aug 13, 2026 by saddlepaddle via Deploy Web #7664
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.

1 participant