Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: prevent refresh label overlap

Louis Beaumontaeb3ebfeecb3
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
index 1cc2767f3..323c9d7a3 100644
--- a/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
@@ -137,6 +137,23 @@ describe("BrainOverview", () => {
expect(screen.getByText("artifact #88 · v2")).toBeTruthy();
});
+ it("keeps one stable visible refresh label while data is loading", async () => {
+ mocks.listBrainViews.mockResolvedValue({
+ status: "ok",
+ data: [populatedView],
+ });
+ render(<BrainOverview />);
+
+ fireEvent.click(await screen.findByTestId("overview-refresh-data"));
+
+ const loadingButton = await screen.findByRole("button", {
+ name: "loading data",
+ });
+ expect(loadingButton).toBeDisabled();
+ expect(loadingButton.textContent).toBe("refresh data");
+ expect(screen.queryByText("loading data")).toBeNull();
+ });
+
it("does not render raw HTML from a markdown card", async () => {
const markdownView: ViewDefinition = {
...populatedView,
diff --git a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
index 2f3c7d1f6..7dcf1044a 100644
--- a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
@@ -1052,6 +1052,7 @@ export function BrainOverview() {
variant="outline"
size="sm"
className="rounded-none"
+ aria-label={refreshIsActive ? "loading data" : "refresh data"}
disabled={refreshIsActive}
onClick={() => void refreshConnectedPipes(view)}
>
@@ -1060,7 +1061,7 @@ export function BrainOverview() {
refreshIsActive ? "animate-spin" : ""
}`}
/>
- {refreshIsActive ? "loading data" : "refresh data"}
+ <span aria-hidden="true">refresh data</span>
</Button>
)}
<Button