Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ function AutomationsPage() {
),
});

const { data: automationRows = [] } = useLiveQuery(
(q) =>
q
.from({ a: collections.automations })
.orderBy(({ a }) => a.createdAt, "desc")
.select(({ a }) => ({ ...a })),
[collections.automations],
);
const { data: automationRows = [], isLoading: automationsLoading } =
useLiveQuery(
(q) =>
q
.from({ a: collections.automations })
.orderBy(({ a }) => a.createdAt, "desc")
.select(({ a }) => ({ ...a })),
[collections.automations],
);
const automations = automationRows as SelectAutomation[];

const { data: userRows = [] } = useLiveQuery(
Expand Down Expand Up @@ -228,7 +229,7 @@ function AutomationsPage() {
</header>

<div className="flex-1 overflow-y-auto px-8 py-6">
{automations.length === 0 ? (
{automationsLoading ? null : automations.length === 0 ? (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 No loading indicator while fetching

While rendering null during load prevents the empty-state flicker, it leaves the content area completely blank until the query settles. A skeleton or spinner would give users a signal that data is on its way, especially on slower machines or large datasets. Consider replacing null with a lightweight placeholder:

Suggested change
{automationsLoading ? null : automations.length === 0 ? (
{automationsLoading ? (
<div className="flex h-32 items-center justify-center text-sm text-muted-foreground">
Loading automations…
</div>
) : automations.length === 0 ? (
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/automations/page.tsx
Line: 232

Comment:
**No loading indicator while fetching**

While rendering `null` during load prevents the empty-state flicker, it leaves the content area completely blank until the query settles. A skeleton or spinner would give users a signal that data is on its way, especially on slower machines or large datasets. Consider replacing `null` with a lightweight placeholder:

```suggestion
				{automationsLoading ? (
					<div className="flex h-32 items-center justify-center text-sm text-muted-foreground">
						Loading automations…
					</div>
				) : automations.length === 0 ? (
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

<AutomationsEmptyState onSelectTemplate={handleSelectTemplate} />
) : (
<>
Expand Down