The floating drag copy hardcoded `maxLines = 1` on both its time label and its title, so picking up a block whose text wrapped clipped it to one line for as long as it was held, and it snapped back on drop. - `DragCopy` now measures the range at its own width and height, exactly as the block does — same `MAX_TIME_LINES` cap, same spare-height rule. - The block's measured title budget rides along on `TimelineDrag`, so the copy spends its height the same way the block did; the copy draws through `BlockTitle` now rather than a bare `Text`, so a wrapped title clips the way the block's does. - That measurement moves into a shared `blockTimeLines`, which Week and Day each had their own copy of. Deviation from the issue: it names only the time label, but the title had the identical hardcode and the two share one height budget — fixing the range alone would just have moved the mismatch to the title. The copy still shows the range on a block too short to carry one; that is the feedback the drag exists for and is left as is. Closes #267 Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de> Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/269
This commit is contained in:
@@ -25,16 +25,16 @@ class EventTitleOverflowTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a multi-line block keeps the ellipsis, since wrapping needs softWrap`() {
|
||||
fun `a multi-line block wraps whole words and clips, spending none on a dot`() {
|
||||
val result = eventTitleOverflowFor(rtl = false, singleLine = false)
|
||||
assertThat(result.overflow).isEqualTo(TextOverflow.Ellipsis)
|
||||
assertThat(result.overflow).isEqualTo(TextOverflow.Clip)
|
||||
assertThat(result.softWrap).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `multi-line in RTL keeps the ellipsis too`() {
|
||||
fun `multi-line in RTL clips too, since softWrap cuts the logical end`() {
|
||||
val result = eventTitleOverflowFor(rtl = true, singleLine = false)
|
||||
assertThat(result.overflow).isEqualTo(TextOverflow.Ellipsis)
|
||||
assertThat(result.overflow).isEqualTo(TextOverflow.Clip)
|
||||
assertThat(result.softWrap).isTrue()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user