fix: KnowledgeView infinite scroll root + calendar event refresh
- KnowledgeView: IntersectionObserver was watching the viewport instead of the card-grid scroll container, causing infinite scroll to stop loading after only ~29 items. Pass card-grid element as `root`. - CalendarView: listen for 'fable:calendar-changed' custom event and call refetchEvents() so tool-created events appear without navigation. - ChatPanel: dispatch 'fable:calendar-changed' when create_event, update_event, or delete_event tool calls succeed. - tools.py: normalize naive datetimes to UTC before storing events so timezone comparisons in list_events queries are always consistent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -333,11 +333,12 @@ function formatDate(iso: string): string {
|
||||
// ─── Infinite scroll ──────────────────────────────────────────────────────────
|
||||
|
||||
const sentinelEl = ref<HTMLElement | null>(null);
|
||||
const cardGridEl = ref<HTMLElement | null>(null);
|
||||
let scrollObserver: IntersectionObserver | null = null;
|
||||
|
||||
function setupScrollObserver() {
|
||||
if (scrollObserver) scrollObserver.disconnect();
|
||||
if (!sentinelEl.value) return;
|
||||
if (!sentinelEl.value || !cardGridEl.value) return;
|
||||
scrollObserver = new IntersectionObserver(
|
||||
(entries) => {
|
||||
if (entries[0].isIntersecting && !loading.value && items.value.length < total.value) {
|
||||
@@ -345,7 +346,7 @@ function setupScrollObserver() {
|
||||
fetchItems();
|
||||
}
|
||||
},
|
||||
{ rootMargin: "200px" }
|
||||
{ root: cardGridEl.value, rootMargin: "200px" }
|
||||
);
|
||||
scrollObserver.observe(sentinelEl.value);
|
||||
}
|
||||
@@ -368,7 +369,7 @@ onUnmounted(() => {
|
||||
});
|
||||
|
||||
watchEffect(() => {
|
||||
if (sentinelEl.value) setupScrollObserver();
|
||||
if (sentinelEl.value && cardGridEl.value) setupScrollObserver();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -471,7 +472,7 @@ watchEffect(() => {
|
||||
</div>
|
||||
|
||||
<!-- Card grid -->
|
||||
<div v-else class="card-grid">
|
||||
<div v-else ref="cardGridEl" class="card-grid">
|
||||
<div
|
||||
v-for="item in items"
|
||||
:key="item.id"
|
||||
|
||||
Reference in New Issue
Block a user