Commit dda47a5
applib/menu_layer: keep a mid-pan reload off the finger-owned offset
menu_layer_update_caches finishes by re-selecting the current row with
MenuRowAlignNone, and prv_corrected_scroll_align promotes that to
MenuRowAlignCenter on center-focused menus. A reload_data arriving
mid-pan (timer, inbox, timeline update) therefore snaps the scroll
offset to re-centre the selection under a finger that is still down --
and the next pan update computes from the gesture's base offset,
jumping the content straight back. The code's own invariant says
menu_layer_set_selected_index cannot be used mid-pan for exactly this
reason.
Keep the promotion, but not while a touch gesture owns the menu: the
finger owns the offset until liftoff, when the carousel settles through
prv_menu_touch_settle_to_center as before. Callers that genuinely want
a re-centre pass MenuRowAlignCenter explicitly and are unaffected, and
the button-path reconcile still promotes because no gesture is active
when buttons are pressed.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>1 parent e7fe4f6 commit dda47a5
2 files changed
Lines changed: 43 additions & 3 deletions
File tree
- src/fw/applib/ui
- tests/fw/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | | - | |
1066 | | - | |
| 1065 | + | |
| 1066 | + | |
1067 | 1067 | | |
1068 | | - | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1069 | 1075 | | |
1070 | 1076 | | |
1071 | 1077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1612 | 1646 | | |
1613 | 1647 | | |
1614 | 1648 | | |
| |||
0 commit comments