Skip to content

Conversation

@lollipopkit
Copy link
Owner

@lollipopkit lollipopkit commented Oct 9, 2025

Fixes #806

Summary by CodeRabbit

  • New Features

    • Quick access to Connection Stats: click the connection count (desktop/web) to open the stats page; new route enabled.
  • Changes

    • Improved dynamic theming to keep color selections in sync.
    • Color preview in app color settings now reflects the primary color.
    • Unified navigation to Connection Stats across the app.
  • Removed

    • Backup password prompt removed from the initial settings page; migration remains available separately.
  • Chores

    • Added new dependencies and updated a core UI library version.

@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2025

Walkthrough

Propagates colorSeed with primary color in dynamic theming; adjusts color preview and save behavior in settings. Removes AppState provider and generated artifacts. Introduces ConnectionStatsPage.route and updates navigation to use it. Removes backup password prompt from settings page. Updates dependencies: adds flutter_gbk2utf8, get_it; bumps fl_lib override.

Changes

Cohort / File(s) Summary
Dynamic theming adjustments
lib/app.dart, lib/view/page/setting/entries/app.dart
Propagate colorSeed alongside primary in dynamic theme builder; settings color preview now uses UIs.primaryColor; removed delayed notify in color save.
Provider and state removal
lib/data/provider/app.dart, lib/data/provider/app.freezed.dart, lib/data/provider/app.g.dart, lib/data/provider/providers.dart
Deleted AppState Freezed model and Riverpod provider plus generated files; updated imports to use fl_lib.dart; removed related annotations/parts.
Connection stats routing and navigation
lib/view/page/server/connection_stats.dart, lib/view/page/server/tab/tab.dart, lib/view/page/server/tab/top_bar.dart, lib/view/page/setting/entries/server.dart
Added ConnectionStatsPage.route; imported where needed; top bar Text wrapped in InkWell to navigate to route; settings entry uses route helper instead of direct Navigator push.
Settings intro change
lib/intro.dart
Removed backup password migration ListTile from initial app settings UI; migration remains available elsewhere.
Dependencies
pubspec.yaml
Added flutter_gbk2utf8 and get_it; updated fl_lib dependency override from v1.0.351 to v1.0.355.

Sequence Diagram(s)

sequenceDiagram
  actor U as User
  participant TB as ServerTopBar
  participant Route as ConnectionStatsPage.route
  participant Router as App Router
  participant Page as ConnectionStatsPage

  U->>TB: Tap connection count (non-mobile)
  TB->>Route: go(context)
  Route->>Router: Navigate to /server/conn_stats
  Router->>Page: Build and show
  Note over Page: Displays connection statistics
Loading
sequenceDiagram
  actor U as User
  participant Settings as App Color Settings
  participant Theme as _buildDynamicColor
  participant UI as UIs

  U->>Settings: Choose light/dark theme & color
  Settings->>Theme: Apply selection
  Theme->>UI: Set primaryColor and colorSeed
  Note over UI: colorSeed kept in sync with primary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A hop and a tap, to stats I go,
New routes burrow where numbers flow.
Colors in sync, seeds snug and bright,
Night to light, the themes feel right.
Old burrows cleared—providers past—
I twitch my nose, commit at last. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title “fix: code editor tool bar” suggests a change to the editor toolbar but the diff does not include any modifications to the code editor or toolbar functionality, instead it focuses on theme color propagation, provider removal, routing, and UI updates. Therefore the title is misleading and does not reflect the primary changes. It should be updated to accurately summarize the core modifications. Please revise the title to clearly reflect the main changes in this PR, such as color seed propagation, app state provider removal, and navigation updates.
Linked Issues Check ⚠️ Warning The changes in this PR do not address the copy and paste issue in the text editor reported in issue #806, as there are no edits to the editor component or selection handling. The modifications focus on theme color handling, state provider removal, and UI navigation, which are unrelated to restoring copy/paste functionality. This fails to meet the linked issue objectives and the editor fix should be implemented or the issue reference removed. Implement the actual fix for copy and paste in the editor component as described in issue #806 or remove the issue linkage if this PR does not intend to address it.
Out of Scope Changes Check ⚠️ Warning The PR introduces extensive changes including removal of the app state provider, theme propagation updates, new routing and UI modifications, and dependency additions that are unrelated to the fix for editor copy and paste functionality. These alterations fall outside the objectives defined in issue #806 and introduce out-of-scope modifications. The editor fix should be isolated and the unrelated changes moved to separate pull requests. Separate the editor copy/paste fix into its own PR and relocate the unrelated theme, provider, routing, and dependency changes into distinct pull requests.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lollipopkit/issue806

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb3e3b4 and f68e14d.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • lib/app.dart (1 hunks)
  • lib/data/provider/app.dart (0 hunks)
  • lib/data/provider/app.freezed.dart (0 hunks)
  • lib/data/provider/app.g.dart (0 hunks)
  • lib/data/provider/providers.dart (1 hunks)
  • lib/intro.dart (0 hunks)
  • lib/view/page/server/connection_stats.dart (1 hunks)
  • lib/view/page/server/tab/tab.dart (1 hunks)
  • lib/view/page/server/tab/top_bar.dart (1 hunks)
  • lib/view/page/setting/entries/app.dart (1 hunks)
  • lib/view/page/setting/entries/server.dart (1 hunks)
  • pubspec.yaml (2 hunks)
💤 Files with no reviewable changes (4)
  • lib/data/provider/app.g.dart
  • lib/data/provider/app.dart
  • lib/data/provider/app.freezed.dart
  • lib/intro.dart
🧰 Additional context used
📓 Path-based instructions (3)
lib/view/**/*.dart

📄 CodeRabbit inference engine (CLAUDE.md)

lib/view/**/*.dart: Prefer widgets/utilities from fl_lib for common UI (e.g., CustomAppBar, context.showRoundDialog, Input, Btnx.cancelOk)
Prefer using libL10n strings before adding new ones to project l10n
Split UI into build, actions, and utils; use extension on to separate concerns

Files:

  • lib/view/page/server/tab/tab.dart
  • lib/view/page/setting/entries/app.dart
  • lib/view/page/server/connection_stats.dart
  • lib/view/page/server/tab/top_bar.dart
  • lib/view/page/setting/entries/server.dart
pubspec.yaml

📄 CodeRabbit inference engine (CLAUDE.md)

Use hive_ce instead of hive for Hive integration

Files:

  • pubspec.yaml
lib/data/provider/**/*.dart

📄 CodeRabbit inference engine (CLAUDE.md)

Organize Riverpod providers by feature under lib/data/provider/

Files:

  • lib/data/provider/providers.dart
🧠 Learnings (1)
📚 Learning: 2025-10-08T09:36:41.671Z
Learnt from: CR
PR: lollipopkit/flutter_server_box#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-08T09:36:41.671Z
Learning: Applies to lib/data/provider/**/*.dart : Organize Riverpod providers by feature under lib/data/provider/

Applied to files:

  • lib/data/provider/providers.dart
🧬 Code graph analysis (1)
lib/app.dart (1)
ios/StatusWidget/StatusWidget.swift (1)
  • dark (595-608)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: check
🔇 Additional comments (11)
lib/app.dart (1)

53-69: LGTM! Color seed synchronization is correct.

The addition of UIs.colorSeed assignments in _buildDynamicColor ensures that the color seed stays synchronized with the primary color when using system dynamic colors. This maintains consistency with the _build method's behavior and prevents potential mismatches between the two values.

lib/view/page/setting/entries/app.dart (2)

92-94: LGTM! Color preview correctly displays synchronized primary color.

The color preview listens to colorSeed changes but displays UIs.primaryColor. This is correct since both values are kept synchronized (as seen in lib/app.dart), and displaying the primary color provides the accurate visual representation of the active theme color.


130-139: LGTM! Immediate feedback is better than delayed notification.

Removing the delayed notification (Future.delayed(Durations.medium1, RNodes.app.notify)) improves user experience by providing immediate visual feedback when the color is saved. The synchronous pop after saving is sufficient.

lib/view/page/server/tab/tab.dart (1)

24-24: LGTM! Import supports route-based navigation.

The import of connection_stats.dart enables access to ConnectionStatsPage.route for route-based navigation, aligning with the navigation pattern updates across the codebase.

lib/view/page/setting/entries/server.dart (1)

42-52: LGTM! Route-based navigation is cleaner.

The change from direct Navigator.push to ConnectionStatsPage.route.go(context) improves navigation consistency across the codebase by using the route helper pattern.

lib/view/page/server/tab/top_bar.dart (1)

45-48: LGTM! Improved UX with tappable connection stats.

Wrapping the connection text in an InkWell with navigation to ConnectionStatsPage.route provides a good user experience by making the connection count tappable. This gives users quick access to detailed connection statistics.

lib/view/page/server/connection_stats.dart (1)

10-11: LGTM! Route constant enables consistent navigation.

Adding the static route constant allows other parts of the application to navigate to this page using the route-based navigation pattern, improving navigation consistency across the codebase.

lib/data/provider/providers.dart (1)

1-1: Verify that appStatesProvider, AppState, and AppStates are exported by fl_lib.dart
The import was changed from app.dart to fl_lib.dart, but these providers and types are still referenced in lib/data/provider/providers.dart (lines 51, 65, 80). Confirm they’re defined in fl_lib.dart or restore the appropriate import.

pubspec.yaml (3)

22-22: Dependency flutter_gbk2utf8 usage verified
Import in lib/data/provider/server/single.dart and the GBK fallback decoding logic confirm the package is used; addition is justified.


68-68: Verify fl_lib v1.0.355 contains the editor toolbar copy/paste fix
The PR only bumps fl_lib from v1.0.351→v1.0.355 with no editor-related code changes. Confirm that v1.0.355 includes the code editor toolbar copy/paste fix (issue #806); if it doesn’t, incorporate those changes into this PR.


28-28: Confirm get_it usage and registration
Detected import and usage in lib/data/res/store.dart (GetIt.instance, Stores.setting). Ensure SettingStore and SnippetStore are registered (e.g., via getIt.registerSingleton or registerLazySingleton) in your app’s initialization (e.g., main.dart) before access.


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

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.

1189版本编辑文件无法复制和粘贴

2 participants