refactor(ssh): Update Terminal page to adapt new copy and paste logic#1054
refactor(ssh): Update Terminal page to adapt new copy and paste logic#1054GT-610 merged 5 commits intolollipopkit:mainfrom
Conversation
…unctionality Update dependency versions and remove the copy button from the terminal page, integrating clipboard functionality into the terminal controller.
| Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoved the app-bar copy action and moved terminal clipboard interactions into TerminalView via new callbacks: Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Convert the _OnTerminalPaste method to an asynchronous implementation and remove duplicate _paste methods.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/view/page/ssh/page/page.dart (1)
368-386: Consider moving terminal action handlers into an actions extension.
_onTerminalCopied,_onTerminalSelectAll, and_onTerminalPasteare action handlers; moving them into a dedicatedpartextension would better preserve separation of concerns in this page.As per coding guidelines "Split UI into build, actions, and utils; use extension on to separate concerns".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/view/page/ssh/page/page.dart` around lines 368 - 386, Extract the three handlers (_onTerminalCopied, _onTerminalSelectAll, _onTerminalPaste) out of the State class and place them into a dedicated extension (e.g., extension _SshPageStateActions on _SshPageState) or a separate part file (page_actions.dart) to follow the "build, actions, utils" split; keep the method signatures and usage intact, ensure the extension is declared on the same private state type (_SshPageState) so it still has access to _termKey, _terminalController, _terminal, context, mounted, and Clipboard, and add a part/part of directive if you move them into a new part file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Nitpick comments: In `@lib/view/page/ssh/page/page.dart`: - Around line 368-386: Extract the three handlers (_onTerminalCopied, _onTerminalSelectAll, _onTerminalPaste) out of the State class and place them into a dedicated extension (e.g., extension _SshPageStateActions on _SshPageState) or a separate part file (page_actions.dart) to follow the "build, actions, utils" split; keep the method signatures and usage intact, ensure the extension is declared on the same private state type (_SshPageState) so it still has access to _termKey, _terminalController, _terminal, context, mounted, and Clipboard, and add a part/part of directive if you move them into a new part file. ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
lib/view/page/ssh/page/page.dartlib/view/page/ssh/page/virt_key.dart
🚧 Files skipped from review as they are similar to previous changes (1)
- lib/view/page/ssh/page/virt_key.dart
…onality Renamed _onTerminalPaste to _onClipboardAction and expanded its functionality Now supports copying selected text to the clipboard and performing paste operations when no text is selected
…hronous completion.
Prevented redundant _onTerminalPaste calls after terminal paste operations
| @coderabbitai review |
✅ Actions performedReview triggered.
|
✅ Actions performedReview triggered.
|
Possibly related issue:
Resolve #984.
Summary by CodeRabbit
New Features
Chores