Skip to content

refactor: add targeted key appearance update mechanism#1966

Merged
Bambooin merged 1 commit intoosfans:developfrom
ENOA-REIAH-UION:key-appearance
Mar 30, 2026
Merged

refactor: add targeted key appearance update mechanism#1966
Bambooin merged 1 commit intoosfans:developfrom
ENOA-REIAH-UION:key-appearance

Conversation

@ENOA-REIAH-UION
Copy link
Copy Markdown
Contributor

Pull request

Issue tracker

Fixes will automatically close the related issues

Fixes #
Fixes #

Feature

Describe features of this pull request

Code of conduct

Code style

Build pass

  • make debug

Manually test

  • Done

Code Review

  1. No wildcards import
  2. Manual build and test pass
  3. GitHub Action CI pass
  4. At least one contributor review and approve
  5. Merged clean without conflicts
  6. PR will be merged by rebase upstream base

Daily build

Login and download artifact at https://github.com/osfans/trime/actions

Additional Info

@ENOA-REIAH-UION ENOA-REIAH-UION force-pushed the key-appearance branch 2 times, most recently from 775e4ee to c23169c Compare March 30, 2026 11:33
@Bambooin Bambooin requested a review from Copilot March 30, 2026 12:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors keyboard redraw behavior by introducing a targeted “key appearance update” broadcast path, so only keys whose visuals depend on Rime state (e.g., composing/menu/paging) are invalidated instead of forcing full-keyboard redraws.

Changes:

  • Introduces onKeyAppearanceUpdate(composing, menu) broadcast plumbing and emits it from InputView when tracked appearance state changes.
  • Tracks and invalidates only state-dependent keys via Keyboard.appearanceStateKeys and per-key indices.
  • Adds KeyboardView.invalidateKeyByIndex() to support targeted redraws.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/main/java/com/osfans/trime/ime/keyboard/KeyboardWindow.kt Switches from composition-based full invalidation to targeted invalidation on key appearance updates.
app/src/main/java/com/osfans/trime/ime/keyboard/KeyboardView.kt Adds per-index key invalidation helper.
app/src/main/java/com/osfans/trime/ime/keyboard/Keyboard.kt Renames key list for stateful appearance and assigns stable key indices.
app/src/main/java/com/osfans/trime/ime/keyboard/Key.kt Adds index field and marks keys with state-dependent behaviors for targeted updates.
app/src/main/java/com/osfans/trime/ime/core/InputView.kt Tracks appearance-related state and broadcasts key appearance updates on change.
app/src/main/java/com/osfans/trime/ime/broadcast/InputBroadcaster.kt Forwards the new key appearance update callback to receivers.
app/src/main/java/com/osfans/trime/ime/broadcast/InputBroadcastReceiver.kt Adds the new onKeyAppearanceUpdate callback to the receiver interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Bambooin Bambooin merged commit d6f3a1a into osfans:develop Mar 30, 2026
4 checks passed
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.

3 participants