Skip to content

refactor: remove dead code and dedupe redundant utilities#1230

Merged
GT-610 merged 6 commits into
mainfrom
cleanup/dead-code
Jul 13, 2026
Merged

refactor: remove dead code and dedupe redundant utilities#1230
GT-610 merged 6 commits into
mainfrom
cleanup/dead-code

Conversation

@GT-610

@GT-610 GT-610 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove 42 unused localization keys (verified zero l10n.xxx call sites) across all app_*.arb files and regenerate l10n.
  • Remove dead tmux code: TmuxSession.setChoice/buildReconnectCommand/buildAutoCommand/choiceNotifier/lastSessionName, and unused displayName getters on TmuxSessionInfo/TmuxWindowInfo.
  • Remove unused res constants: Defaults.primaryColor, Miscs.multiBlankReg, Miscs.jsonEncoder, Urls.cdnBase (and their now-unused dart:ui/dart:convert imports).
  • Drop unused ChainComparator.comparing/thenCompareByReversed/reversed() and SudoPassword.hasOverride.
  • Dedupe shellSingleQuote: container.dart no longer carries a copy; it forwards to the canonical core/utils/shell_quote.dart implementation (a single-line delegator is required because part files cannot reference imported top-level names inside extension method bodies).
  • Replace deprecated EquatableMixin with Equatable mixin in disk.dart; complete the tmux_export.dart barrel export with tmux_window_info.dart.
  • Update tests that covered the removed dead code.

Verification

  • dart analyze lib reports no issues.
  • flutter gen-l10n regenerated.
  • flutter test passes (331 tests).

Notes

  • Only truly-unused l10n keys were removed; keys that duplicate libL10n names but are still referenced were intentionally left in place.
  • Net reduction of ~3173 lines (mostly generated l10n and per-locale arb entries).

Summary by CodeRabbit

  • Refactor
    • Simplified comparator and password-override APIs by removing obsolete helpers.
    • Streamlined tmux session handling by removing remembered-session and reconnect/auto-command support; session/window selector labels are now simplified.
    • Centralized shell quoting for more consistent command handling.
    • Removed unused constants and display helpers.
  • Localization
    • Pruned outdated translation keys across multiple languages, reducing the set of UI messages shown.
  • Tests
    • Updated comparator and tmux session info tests to match the revised APIs and display behavior.

@coderabbitai

coderabbitai Bot commented Jul 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bbf0cd2f-af3b-4bf8-9425-7db127aa9cd3

📥 Commits

Reviewing files that changed from the base of the PR and between 371a161 and 08baa6e.

📒 Files selected for processing (1)
  • lib/data/model/server/disk.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/data/model/server/disk.dart

📝 Walkthrough

Walkthrough

The pull request removes obsolete comparator, sudo-password, tmux, resource, and localization APIs. It centralizes shell quoting through a shared utility, updates tmux exports, changes Disk equality mixin usage, removes tmux display and reconnect state, and updates related tests. Translation files across supported locales prune obsolete UI, SSH, server, Docker, update, and search keys.

Possibly related PRs

Suggested reviewers: lollipopkit

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing dead code and redundant utilities across the project.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup/dead-code

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

@coderabbitai coderabbitai Bot requested a review from lollipopkit July 13, 2026 11:19
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 13, 2026
@GT-610 GT-610 merged commit 75d7438 into main Jul 13, 2026
4 checks passed
@GT-610 GT-610 deleted the cleanup/dead-code branch July 13, 2026 11:34
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