Dead code removal 2#78
Conversation
Remove unused code identified by deep scan: - Delete kit/core/func.dart (Fns.throttle unused) - Delete kit/core/build.dart (BuildMode unused after dprint removal) - Delete kit/core/ext/string.dart (StringX.launchUrl unused) - Remove dprint/lprint and unused Loggers.root/store/route/app from logger.dart - Remove nullOr() extension and nvn() function from obj.dart - Remove RNodeX.listen(), ValBuilder, listenVal(), EmptyListenable, RNodes from rnode.dart - Remove WindowFrameConfig.setShowCaption() (never called) - Remove unused platform constants: isAndroid, isIOS, isWeb, isMobile - Remove ~20 unused UIs style constants (keep textGrey, textRed, text15, placeholder, height13) - Remove InstanceDialog.onSave parameter and dead branch in _submit - Clean up barrel exports in kit.dart
Performance: - Extract _statusOrder Map to static const (avoids allocation per comparison) - Extract _compareIgnoreCase helper for case-insensitive sort Code quality: - Move _pruneSelection mutation inside setState callback - Move peers fetch state mutations inside setState in task_details_dialog - Remove no-op empty setState in instance_dialog host/port onChange handlers
|
Warning Review limit reached
More reviews will be available in 31 minutes and 22 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR systematically simplifies the setsuna kit package and refactors dialog state management patterns. It removes unused utilities (BuildMode enum, Fns throttle, logger setup, extensions), refactors platform detection constants, minimizes UI resources, and eliminates builder helpers from RNode. Dialog state updates are modernized to use explicit setState calls instead of conditional rebuilds, and instance dialogs no longer rely on callbacks for result passing. ChangesKit Package API Cleanup
Dialog State Management Improvements
Download Service Optimization
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/pages/download_page/components/task_details_dialog.dart`:
- Around line 225-233: fetchPeersIfNeeded() leaves isLoadingPeers true on early
returns and calls setState after dispose; refactor so the peers cleanup
(clearing isLoadingPeers and updating peersError/peers list) runs in a finally
block that updates state only if the widget/context is still mounted.
Concretely: wrap the peersClient!.getPeers(...) call in try/catch and capture
results into local variables (e.g., peersResult and peersErrorLocal), handle
instance == null by setting peersErrorLocal and skipping the fetch, then in a
finally block do if (context.mounted) setState(() { peersError =
peersErrorLocal; isLoadingPeers = false; peers = peersResult; }); and remove the
duplicated setState calls inside try/catch so setState is only invoked once in
the finally block; ensure you reference fetchPeersIfNeeded(),
disposeResources(), peersClient!.getPeers(), peersError and isLoadingPeers in
your edits.
🪄 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 Plus
Run ID: b94c971d-ca26-4b83-a474-afbb0780c1df
📒 Files selected for processing (14)
lib/kit/core/build.dartlib/kit/core/ext/obj.dartlib/kit/core/ext/string.dartlib/kit/core/func.dartlib/kit/core/logger.dartlib/kit/core/platform.dartlib/kit/core/rnode.dartlib/kit/kit.dartlib/kit/res/ui.dartlib/kit/widgets/virtual_window_frame.dartlib/pages/download_page/components/task_details_dialog.dartlib/pages/download_page/download_page.dartlib/pages/instance_page/components/instance_dialog.dartlib/services/download_data_service.dart
💤 Files with no reviewable changes (9)
- lib/kit/core/platform.dart
- lib/kit/core/build.dart
- lib/kit/core/func.dart
- lib/kit/core/ext/string.dart
- lib/kit/res/ui.dart
- lib/kit/kit.dart
- lib/kit/core/rnode.dart
- lib/kit/core/ext/obj.dart
- lib/kit/core/logger.dart
- Replace early return on instance==null with local error variable - Move setState into finally block with context.mounted guard - Use local peersResult/peersErrorLocal to avoid duplicated setState
Summary by CodeRabbit
Bug Fixes
Refactor