Skip to content

chore: remove the unused Today screen and other dead code - #211

Open
ayuxy027 wants to merge 4 commits into
CopilotKit:mainfrom
ayuxy027:chore/remove-dead-code
Open

ayuxy027 wants to merge 4 commits into
CopilotKit:mainfrom
ayuxy027:chore/remove-dead-code

Conversation

@ayuxy027

Copy link
Copy Markdown
Contributor

What this removes

Code that nothing uses anymore, so it doesn't have to be read, kept in sync or maintained:

  • The Today screen (about 315 lines in screens.tsx). It's never shown: the app sends the "today" section to Chat, and no file imports the screen. This has been the case since the first release. The redirect from "today" to Chat stays, so existing links still work. Three imports that only this screen used are removed with it.
  • ChatWork in agent-ui.tsx. Nothing renders it; tasks inside a chat are shown by thread-artifacts.tsx.
  • ExecutionBackend in the domain package. No code implements or uses it.
  • The toolCallId prop on DesktopToolCard. The card never reads it, but both places that show the card had to pass it.

Helpers these pieces shared with live code (TaskCard's compact mode, Mascot, the calendar date helpers) are still used elsewhere and are kept.

How I checked

  • Searched the whole repository for every removed name: nothing else refers to them.
  • pnpm lint, pnpm typecheck, pnpm test, pnpm build:server and pnpm build:web pass.
  • No behavior change, so no new tests.

Each removal is a separate commit, so any of them is easy to drop if you'd rather keep it.

TodayScreen is never rendered: the app opens Chat for the 'today' section and
no file imports the screen. Remove it and the imports only it used. The
'today' to Chat redirect stays for existing links.
Nothing renders ChatWork; tasks in a chat are shown by thread-artifacts.
The card never read it, but both callers had to pass it.
@caspianchan31

Copy link
Copy Markdown

Read through the diff and checked the call sites on main before merge.

Confirmed dead:

  • TodayScreen: on main the only references are the screen itself and its test; nothing registers a route to it. On this branch App.tsx maps "today" to the Chat screen and screens.tsx no longer renders it, so old deep links still resolve.
    • ChatWork / ExecutionBackend: a code search on main shows both only in packages/domain/src/index.ts, with zero consumers.
    • Mascot is still rendered in App.tsx (welcome sheet, loading screen, top bar), so keeping the component while dropping the screens.tsx import is correct.
    • desktop-tool-card.tsx: the removed onPress prop has no remaining use in the component body.
      One non-blocking thing to double-check: persisted navigation state. The today→chat mapping covers in-app navigation and deep links, but if the app ever persists React Navigation state across launches, an existing install that upgrades while "today" was the active tab will restore a route name that no longer exists, and React Navigation throws on an unknown route in restored state. Worth clearing or migrating persisted state on upgrade, or confirming that state isn't persisted.

Minor: ChatWork and ExecutionBackend are removed from the domain package's exports. Fine for an internal workspace package; if packages/domain is ever published on its own, that deletion is a breaking change and deserves a note.

Nice that the screen test was deleted in the same commit instead of left orphaned.

This branch has not been deployed

No deployments
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.

2 participants