Skip to content

Open-source document signature platform. Not affiliated with DocuSign.

TypeScript

Dashboard: switching between Mine and Everyone's keeps the old search

rayfernando133759d897213b91
diff --git a/e2e/signing-flow.spec.ts b/e2e/signing-flow.spec.ts
index 018556f..acddb40 100644
--- a/e2e/signing-flow.spec.ts
+++ b/e2e/signing-flow.spec.ts
@@ -1388,6 +1388,14 @@ test("a signer who declines is told the decline was recorded, not that the link
await search.press("Enter");
await expect(page).toHaveURL(/\/dashboard\?view=all&q=/);
await expect(card).toBeVisible();
+
+ // Switching views drops the search, in the box too.
+ await page.getByRole("link", { name: "Mine" }).click();
+ await expect(page).toHaveURL(/\/dashboard$/);
+ await expect(search).toHaveValue("");
+ await page.getByRole("link", { name: "Everyone's" }).click();
+ await expect(page).toHaveURL(/\/dashboard\?view=all$/);
+ await expect(search).toHaveValue("");
await card.click();
await expect(page).toHaveURL(new RegExp(`/envelopes/${envelopeId}$`));
await expect(page.getByText(`Sent by ${senderLabel}`)).toBeVisible();
diff --git a/src/app/(app)/dashboard/page.tsx b/src/app/(app)/dashboard/page.tsx
index 005e201..d20e6f4 100644
--- a/src/app/(app)/dashboard/page.tsx
+++ b/src/app/(app)/dashboard/page.tsx
@@ -94,6 +94,8 @@ export default async function DashboardPage({
return (
<DashboardShell
+ // A new search or view starts the shell afresh, with its own search box.
+ key={`${String(showAll)}:${search}`}
envelopes={result?.envelopes}
initialSearch={search}
initialState={initialState}