Skip to content

add return after pasting option - #162

Merged
eagleoflqj merged 1 commit into
masterfrom
clipboard-return-after-paste
Oct 28, 2026
Merged

eagleoflqj merged 1 commit into
masterfrom
clipboard-return-after-paste

Conversation

@eagleoflqj

@eagleoflqj eagleoflqj commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Add a disabled-by-default "Return after pasting" clipboard option, placed after the history limit and before tracking-parameter removal. When enabled, pasting a history entry uses the existing return action to restore the previous keyboard layout.

Validated with an arm64 simulator build and code signing, format/lint checks, and settings-page checks for Chinese localization, ordering and the default value. The paste-and-return interaction was not manually verified because the temporary simulator did not load the keyboard extension.

Summary by CodeRabbit

  • New Features
    • Added an option to return to the previous display mode after pasting a clipboard entry. The option is off by default; when enabled, the clipboard view closes after pasting.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54984576-1f24-4c11-99f8-a60872f14bec
Commits

Reviewing files that changed from the base of the PR and between 55cbc95 and 4f004b7.

Files selected for processing: 5
  • common/runtime-api.h
  • common/runtime_keyboard.cpp
  • iosfrontend/iosfrontend.h
  • po/zh_CN.po
  • uipanel/Clipboard.swift

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The iOS clipboard configuration adds a return-after-paste option. Clipboard commits read the option through the runtime API and pop the display mode when it is enabled.

Changes: Clipboard Return After Paste

Layer / File(s) Summary
Configure and expose the option
iosfrontend/iosfrontend.h, common/runtime-api.h, common/runtime_keyboard.cpp, po/zh_CN.po
The clipboard configuration adds a disabled-by-default option. The frontend and runtime API expose its value. A Simplified Chinese translation is added.
Apply the option after clipboard commits
uipanel/Clipboard.swift
After committing an entry’s text, commitEntry() pops the display mode when the option is enabled.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Clipboard
  participant RuntimeAPI
  participant FcitxBridge as with_fcitx
  participant IosFrontend
  participant ViewModel
  Clipboard->>Clipboard: Commit entry text
  Clipboard->>RuntimeAPI: isClipboardReturnAfterPasteEnabled()
  RuntimeAPI->>FcitxBridge: Read frontend option
  FcitxBridge->>IosFrontend: returnAfterPaste()
  IosFrontend-->>FcitxBridge: Configured option value
  FcitxBridge-->>RuntimeAPI: Option value
  RuntimeAPI-->>Clipboard: Enabled or disabled
  opt Option is enabled
    Clipboard->>ViewModel: popDisplayMode()
  end
Loading

Possibly related PRs

Merge Risk: Minimal · up to 4f004

The option is correctly wired and limited to clipboard-history activation; the change is ready to merge after normal interaction validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 and concisely describes the main change: adding a return-after-pasting option.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

IPA comparison

No difference.

@eagleoflqj
eagleoflqj merged commit 3cdbbbd into master Oct 28, 2026
7 checks passed
@eagleoflqj
eagleoflqj deleted the clipboard-return-after-paste branch October 28, 2026 05:14
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