Skip to content

fix(linux): restore clipboard fallback after fcitx failure - #610

Merged
H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/linux-fcitx-clipboard-fallback
Jun 6, 2026
Merged

H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/linux-fcitx-clipboard-fallback

Conversation

@H-Chris233

@H-Chris233 H-Chris233 commented Jun 6, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Summary

  • keep Linux fcitx5 CommitText as the first insert path
  • fall back to the existing clipboard paste path when fcitx commit_text fails
  • make insert_via_clipboard_fallback bypass fcitx and exercise the real clipboard fallback directly
  • add Linux branch tests for commit success, commit failure, and empty input

Verification

  • rustfmt --edition 2021 "openless-all/app/src-tauri/src/insertion.rs"
  • cargo test --manifest-path "openless-all/app/src-tauri/Cargo.toml" insertion -- --test-threads=1
  • cargo check --manifest-path "openless-all/app/src-tauri/Cargo.toml"
  • git diff --check

PR Type

Bug fix, Tests


Description

  • Refactor Linux insertion with clipboard fallback on fcitx failure

  • Direct clipboard fallback for explicit fallback path

  • Add Linux branch tests for key scenarios


Diagram Walkthrough

flowchart LR
  insert["insert() call"] --> fcitx["fcitx commit_text"]
  fcitx -- success --> Inserted["InsertStatus::Inserted"]
  fcitx -- failure --> clipboard["clipboard paste fallback"]
  clipboard --> status["CopiedFallback / Failed"]
Loading

File Walkthrough

Relevant files
Bug fix
insertion.rs
Restructure Linux insertion with clipboard fallback           

openless-all/app/src-tauri/src/insertion.rs

  • Restructured Linux insert() to use
    insert_with_fcitx_or_clipboard_fallback
  • insert_via_clipboard_fallback now bypasses fcitx and calls
    insert_with_clipboard_restore directly
  • Added three unit tests for Linux: commit success skips fallback,
    commit failure uses fallback, empty input returns CopiedFallback
+115/-14

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233
H-Chris233 merged commit a1fc7c5 into Open-Less:beta Jun 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant