Commit f259b95
authored
Fix auto_scroll end-following past code blocks / nested scrollables (#6642)
* Fix auto_scroll end-following past code blocks / nested scrollables
Two issues broke auto_scroll's end-following when a tall child (e.g. a Markdown
code block) was inserted:
- The ScrollMetricsNotification listener reacted to *nested* scrollables (a code
block renders inside a horizontal scroller), tracking the wrong extent. Only
react to this scrollable's own metrics (notification.depth == 0).
- _onScroll unpinned purely on proximity (pixels >= max - threshold). A tall
insert jumps maxScrollExtent past the threshold in one frame while pixels
stays put, flipping to unpinned so it stopped following. Now it only unpins
when the user scrolls *up* (pixels decrease) and re-pins at the end; content
growing beneath a stationary position keeps it pinned.
* Fix embedded FletApp stdout/stderr dropped by the framed transport
The Pyodide↔Dart postMessage transport frames every packet as [type:u8][payload]
(0x00 = MsgPack Flet protocol frame, 0x01 = raw DataChannel frame), and
PyodideConnection.send_message prepends the 0x00 byte. The python_output shim,
however, posted the raw msgpack [7, {...}] with no type byte, so the Dart side
read msgpack's leading 0x92 (array-of-2 marker) as an unknown packet type and
silently dropped every stdout/stderr line — the host page's Console pane never
saw embedded-app output. Prepend the 0x00 type byte in both worker templates
(client + cookiecutter build template).1 parent 4645958 commit f259b95
3 files changed
Lines changed: 33 additions & 5 deletions
File tree
- client/web
- packages/flet/lib/src/controls
- sdk/python/templates/build/{{cookiecutter.out_dir}}/web
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
98 | 112 | | |
99 | 113 | | |
100 | 114 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
| |||
0 commit comments