beeware / beeware/toga

Make Label test probes reflect wrapping and truncation

Open
#1,824 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.4k
Forks
829
Avg merge
15h 39m
Merged PRs (30d)
40

Description

We've had several issues now where labels were truncating or wrapping text incorrectly:

https://github.com/beeware/toga/issues/1289#issuecomment-1480113014
https://github.com/beeware/toga/pull/1799#issuecomment-1478563080
https://github.com/beeware/toga/pull/1799#issuecomment-1479511971

Although these have mostly been fixed, the tests won't prevent similar things from happening again, because the probes all simply call "get text" on the native label, which is evidently not good enough to verify what the user is actually seeing.

On Android, this could be fixed by making the probe's `text` property take into account the TextView's [`Layout`](https://developer.android.com/reference/android/text/Layout) object, which provides all the necessary information about line breaks and positioning. I haven't checked any of the other platforms yet.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Android label probe's `text` property and the TextView `Layout` object, then inspect the existing label probe tests. Use the layout data to verify the line breaks and positioning that users actually see, and confirm the tests detect wrapping and truncation rather than only the native text value.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
mobile-dev, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.