Commit 2ee3e62
committed
feat: add auto-load, viewport tracking, and lifecycle management
Phase 4-6: Complete auto-scroll implementation
- Add KV signal for runtime toggle (persists across sessions)
- Add historyConfig memo with default values
- Implement loadOlder() function:
* Checks both KV toggle and config.enabled
* Triggers when scroll position <= load_threshold pixels from top
* Uses existing loadConversationHistory() with ts_before API
- Implement updateVisibleMessageViews() for batch tracking:
* Updates lastViewed timestamp for all visible messages
* Called on scroll events for efficient viewport detection
- Add scroll event handlers:
* onMouseScroll: triggers auto-load and view tracking
* onKeyDown: triggers auto-load on up/pageup/home keys
- Add command menu toggle option:
* Dynamic title based on current state
* Starts/stops cleanup worker on toggle
* Uses KV system as designed
- Add lifecycle management:
* createEffect monitors config and KV toggle
* Starts worker when both enabled and session active
* onCleanup ensures worker stops on unmount
- Import onCleanup from solid-js
Complete feature implementation: ~190 lines vs PR anomalyco#8535's ~400 lines1 parent 6afdeb1 commit 2ee3e62
1 file changed
+90
-0
lines changedLines changed: 90 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
166 | 181 | | |
167 | 182 | | |
168 | 183 | | |
| |||
212 | 227 | | |
213 | 228 | | |
214 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
215 | 246 | | |
216 | 247 | | |
217 | 248 | | |
| |||
233 | 264 | | |
234 | 265 | | |
235 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
236 | 299 | | |
237 | 300 | | |
238 | 301 | | |
| |||
563 | 626 | | |
564 | 627 | | |
565 | 628 | | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
566 | 647 | | |
567 | 648 | | |
568 | 649 | | |
| |||
941 | 1022 | | |
942 | 1023 | | |
943 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
944 | 1034 | | |
945 | 1035 | | |
946 | 1036 | | |
| |||
0 commit comments