Skip to content

Multiple UI problem fixes and improvements#1990

Merged
Bambooin merged 2 commits intoosfans:developfrom
lzlv312:pr_20260417
Apr 18, 2026
Merged

Multiple UI problem fixes and improvements#1990
Bambooin merged 2 commits intoosfans:developfrom
lzlv312:pr_20260417

Conversation

@lzlv312
Copy link
Copy Markdown
Contributor

@lzlv312 lzlv312 commented Apr 17, 2026

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

@lzlv312 lzlv312 marked this pull request as draft April 17, 2026 10:23
@lzlv312 lzlv312 marked this pull request as ready for review April 17, 2026 11:46
@Bambooin Bambooin requested a review from Copilot April 18, 2026 01:57
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

This PR extends the theme “window” styling options and hardens a custom text view against edge-case crashes, improving candidate window appearance (border/shadow) and text scaling stability.

Changes:

  • Add window.border and window.shadow theme options to the theme model, schema, and example YAMLs.
  • Apply window border and shadow styling to CandidatesView via ColorManager.getDecorDrawable stroke and View.elevation.
  • Prevent divide-by-zero / NaN baseline issues in AutoScaleTextView when measured text bounds are zero.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
doc/trime-schema.json Adds window.border and window.shadow to the JSON schema for validation/autocomplete.
app/src/main/java/com/osfans/trime/ime/core/AutoScaleTextView.kt Adds guards against zero-size text bounds and invalid baseline values.
app/src/main/java/com/osfans/trime/ime/composition/CandidatesView.kt Uses new theme options to render border and elevation shadow on the candidates window.
app/src/main/java/com/osfans/trime/data/theme/model/Window.kt Adds border and shadow to the decoded/parcelable window theme model.
app/src/main/assets/shared/trime.yaml Documents new window options in the default shared theme YAML.
app/src/main/assets/shared/tongwenfeng.trime.yaml Documents new window options in the tongwenfeng shared theme YAML.

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

# min_width: 0 # 最小宽度(整数)
# corner_radius: 0 # 圆角半径(浮点)
# border: 0 # 边框宽度(整数)
# shadow: 0.0 # 阴影半径(浮点)
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The new shadow window option is labeled as “阴影半径”, but it is applied via View.elevation (a Z/elevation distance in dp/px), not a blur radius. Please update the comment wording (and ideally mention it maps to elevation) to avoid misleading theme authors.

Suggested change
# shadow: 0.0 # 阴影半径(浮点)
# shadow: 0.0 # 阴影高度(elevation,浮点)

Copilot uses AI. Check for mistakes.
# min_width: 0 # 最小宽度(整数)
# corner_radius: 0 # 圆角半径(浮点)
# border: 0 # 边框宽度(整数)
# shadow: 0.0 # 阴影半径(浮点)
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The new shadow window option is commented as “阴影半径”, but the code uses it as View.elevation (elevation/Z in dp/px), not a blur radius. Please adjust the comment to describe elevation (and units) so theme config matches runtime behavior.

Suggested change
# shadow: 0.0 # 阴影半径(浮点
# shadow: 0.0 # 阴影高度/视图高程(elevation,浮点,dp

Copilot uses AI. Check for mistakes.
@Bambooin Bambooin merged commit 23e3ebd into osfans:develop Apr 18, 2026
8 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