mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:07:40 +01:00
feat(refresh): AutoRefresh on /today, /memory, /projects (60s)
Mount the existing <AutoRefresh /> on the three other server-rendered status surfaces. 60s cadence — longer than /system's 30s because these pages' data changes more slowly (commitments, projects, memory entities) and an extra Neon round-trip per minute is cheap. Deviation from the session next: deliberately SKIPPED /control. Its body is the ControlPanel client component, which already manages its own polling via useControlData + cockpit:refresh listener — router.refresh() would only re-render the static PageLayout wrapper, providing no visible benefit while paying a Neon round-trip. First principles trump the "mount on every status surface" pattern: AutoRefresh helps server components, not client-state owners. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
3 files changed
+6
No files matched your search
@@ -8,6 +8,7 @@ import { EmptyState } from "@/components/ui/empty-state";
|
||||
import { ENTITY_TYPE, INTERACTION_DIRECTION, type EntityType } from "@/lib/constants/statuses";
|
||||
import { ProgressBar } from "@/components/ui/progress-bar";
|
||||
import { PullToRefresh } from "@/components/shared/PullToRefresh";
|
||||
import { AutoRefresh } from "@/components/shared/AutoRefresh";
|
||||
|
||||
export const metadata = { title: "Memory" };
|
||||
|
||||
@@ -141,6 +142,7 @@ export default async function MemoryPage() {
|
||||
})}
|
||||
</div>
|
||||
</Card>
|
||||
<AutoRefresh intervalMs={60_000} />
|
||||
</PageLayout>
|
||||
</PullToRefresh>
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ProjectGrid } from "@/components/projects/ProjectGrid";
|
||||
import { NewProjectButton } from "@/components/projects/NewProjectButton";
|
||||
import { requirePageUserId } from "@/lib/session";
|
||||
import { PullToRefresh } from "@/components/shared/PullToRefresh";
|
||||
import { AutoRefresh } from "@/components/shared/AutoRefresh";
|
||||
|
||||
export const metadata = { title: "Projects" };
|
||||
|
||||
@@ -29,6 +30,7 @@ export default async function ProjectsPage() {
|
||||
<ProjectGrid projects={projects} />
|
||||
</Suspense>
|
||||
</Card>
|
||||
<AutoRefresh intervalMs={60_000} />
|
||||
</PageLayout>
|
||||
</PullToRefresh>
|
||||
);
|
||||
|
||||
@@ -23,6 +23,7 @@ import { requirePageUserId, getCurrentUserName } from "@/lib/session";
|
||||
import { getUserProjects, getOrgProjects } from "@/db/queries/user-projects";
|
||||
import { PLAN_DAY_PROMPT, WRAP_UP_PROMPT } from "@/lib/constants/today";
|
||||
import { PullToRefresh } from "@/components/shared/PullToRefresh";
|
||||
import { AutoRefresh } from "@/components/shared/AutoRefresh";
|
||||
|
||||
export const metadata = { title: "Today" };
|
||||
|
||||
@@ -122,6 +123,7 @@ export default async function TodayPage() {
|
||||
<SubscriptionsCard />
|
||||
</Suspense>
|
||||
</div>
|
||||
<AutoRefresh intervalMs={60_000} />
|
||||
</div>
|
||||
</PullToRefresh>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user