Skip to content

new: add copy btn for ask ai#975

Merged
lollipopkit merged 1 commit intomainfrom
lollipopkit/issue955
Dec 7, 2025
Merged

new: add copy btn for ask ai#975
lollipopkit merged 1 commit intomainfrom
lollipopkit/issue955

Conversation

@lollipopkit
Copy link
Copy Markdown
Owner

@lollipopkit lollipopkit commented Dec 7, 2025

Fixes #955

Summary by CodeRabbit

Release Notes

  • New Features

    • Added copy button to assistant messages for quick clipboard access.
  • Bug Fixes

    • Terminal toolbar now displays consistently across all devices.
  • Chores

    • Removed debug log statements.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

Three modifications targeting the SSH page: removing runtime log statements from server status handling, adding copy-to-clipboard functionality for AI assistant responses, and changing the terminal toolbar visibility to always display rather than conditionally on mobile.

Changes

Cohort / File(s) Summary
Logging adjustments
lib/data/provider/server/single.dart
Commented out two runtime info log statements: one logging the status command execution and another logging the response length
SSH page UI enhancements
lib/view/page/ssh/page/ask_ai.dart, lib/view/page/ssh/page/page.dart
Added _copyText() helper method and updated assistant message rendering to include a copy button for message content; changed TerminalView's toolbar visibility from mobile-conditional to always-on

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • ask_ai.dart — Widget tree restructuring with new helper method warrants verification of the Column/Row layout and copy button integration
  • page.dart — Single property change; verify intent and impact on mobile UX
  • single.dart — Logging removal; confirm no diagnostic impact

Possibly related PRs

  • #940 — Also modifies ask_ai.dart to restructure the ask-AI UI layout (disclaimer and input area), making it closely related to the UI enhancements in this PR
  • #937 — Also modifies page.dart in the same SSH page class, adding connection-health tracking alongside this toolbar visibility change

Poem

🐰 A rabbit hops through chat logs with glee,
Copy buttons blooming for all to see,
Toolbars now standing both short and tall,
The assistant's wisdom—shared by all! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes: disabling log statements in single.dart and modifying toolbar visibility in page.dart are unrelated to adding copy functionality for AI messages. Remove unrelated changes to single.dart and page.dart; focus only on the copy button feature for ask_ai.dart that addresses issue #955.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a copy button for the AI ask feature, which is the primary focus of the changeset.
Linked Issues check ✅ Passed The pull request implements the core requirement from issue #955 by adding copy functionality for AI conversation content via a new _copyText helper and copy button.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lollipopkit/issue955

📜 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 6458e73 and eeb9421.

📒 Files selected for processing (3)
  • lib/data/provider/server/single.dart (1 hunks)
  • lib/view/page/ssh/page/ask_ai.dart (2 hunks)
  • lib/view/page/ssh/page/page.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
lib/data/provider/**/*.dart

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • lib/data/provider/server/single.dart
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/ssh/page/page.dart
  • lib/view/page/ssh/page/ask_ai.dart
🧠 Learnings (2)
📚 Learning: 2025-10-08T09:36:41.682Z
Learnt from: CR
Repo: lollipopkit/flutter_server_box PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-08T09:36:41.682Z
Learning: Applies to lib/data/model/server/**/*.dart : Place server management models under lib/data/model/server/

Applied to files:

  • lib/data/provider/server/single.dart
📚 Learning: 2025-10-08T09:36:41.682Z
Learnt from: CR
Repo: lollipopkit/flutter_server_box PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-08T09:36:41.682Z
Learning: Applies to lib/data/model/ssh/**/*.dart : Place SSH models under lib/data/model/ssh/

Applied to files:

  • lib/view/page/ssh/page/page.dart
⏰ 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 (4)
lib/data/provider/server/single.dart (1)

295-295: LGTM - log verbosity reduction.

The commented-out info logs don't affect functionality. The status command execution and response processing remain unchanged.

Also applies to: 303-303

lib/view/page/ssh/page/page.dart (1)

255-255: LGTM - toolbar now always visible.

Making the terminal toolbar always visible (instead of mobile-only) improves feature discoverability across all platforms, including the new "Ask AI" functionality.

lib/view/page/ssh/page/ask_ai.dart (2)

253-258: LGTM - well-implemented copy helper.

The _copyText helper correctly handles empty text, checks widget lifecycle before showing feedback, and follows Flutter best practices. Consistent with the existing _copyCommand implementation.


320-336: LGTM - copy functionality successfully added.

The assistant message bubble now includes a copy button that addresses issue #955. The implementation correctly:

  • Preserves original content for accurate markdown rendering and copying
  • Positions the copy button consistently with the command bubble pattern
  • Integrates cleanly with the new _copyText helper

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 and usage tips.

@lollipopkit lollipopkit merged commit 3f15cae into main Dec 7, 2025
2 checks passed
@lollipopkit lollipopkit deleted the lollipopkit/issue955 branch December 7, 2025 09:51
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.

AI对话内容希望添加复制功能

1 participant