From a70ca931024578938bce1d1f1c36472a43baf745 Mon Sep 17 00:00:00 2001 From: kristianwind Date: Mon, 24 Aug 2026 15:37:17 +0200 Subject: [PATCH] feat(notes): an Archive button in the open note's footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Archiving a single note meant finding its row in the list and its hover-only button. With a note open to read or write, the one place you would reach for it — its own footer, beside Gem and Slet — had no way to put it away. There is one now: Arkivér between Save and Delete, which reads "bring it back" once the note is already archived. Owner only, like delete, and it runs the same archive the row button does — the note leaves the list without leaving the account. e2e: archiving from the footer takes the note off the list, the archive holds it with a bring-back button, and bringing it back returns it. The existing bulk-archive test is scoped to the selection bar, now that "Arkivér" also lives in the footer. Co-Authored-By: Claude Opus 5 --- web/e2e/smoke.spec.js | 31 ++++++++++++++++++++++++++++++- web/src/routes/noter/+page.svelte | 6 ++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/web/e2e/smoke.spec.js b/web/e2e/smoke.spec.js index 1e62b6a..f41c99d 100644 --- a/web/e2e/smoke.spec.js +++ b/web/e2e/smoke.spec.js @@ -3158,6 +3158,34 @@ test('en note kan trækkes hen på et projekt i sidebjælken', async ({ page }) expect(trouble).toEqual([]); }); +test('en note kan arkiveres fra sin egen fod, og hentes frem igen', async ({ page }) => { + const trouble = watchForTrouble(page); + await page.goto('/noter'); + + await page.getByRole('button', { name: 'Ny note' }).click(); + const ed = page.getByRole('textbox', { name: 'Notens tekst' }); + await ed.click(); + await page.keyboard.type('Kvartalsplan'); + await ed.blur(); + await page.waitForTimeout(700); + + // The Arkivér button in the note's footer puts it away: it leaves the list. + await page.locator('footer .actions .button', { hasText: 'Arkivér' }).click(); + await expect(page.locator('.notes button.row', { hasText: 'Kvartalsplan' })).toHaveCount(0); + + // It is in the archive, where the same button now offers to bring it back. + await page.getByRole('button', { name: 'Vis arkivet' }).click(); + await page.locator('.notes button.row', { hasText: 'Kvartalsplan' }).click(); + await page.locator('footer .actions .button', { hasText: 'Tag frem igen' }).click(); + await expect(page.locator('.notes button.row', { hasText: 'Kvartalsplan' })).toHaveCount(0); + + // And back in the ordinary list. + await page.getByRole('button', { name: 'Vis arkivet' }).click(); + await expect(page.locator('.notes button.row', { hasText: 'Kvartalsplan' })).toBeVisible(); + + expect(trouble).toEqual([]); +}); + test('en monospace-linje kan forlades — på retur og gennem menuen', async ({ page }) => { const trouble = watchForTrouble(page); await page.goto('/noter'); @@ -3293,7 +3321,8 @@ test('flere noter kan markeres, arkiveres og hentes frem igen', async ({ page }) await rows.filter({ hasText: 'Bravo' }).click({ modifiers: ['Meta'] }); await expect(page.getByText('2 markeret')).toBeVisible(); - await page.getByRole('button', { name: 'Arkivér', exact: true }).click(); + // The selection bar's Arkivér, not the open note's own in the footer. + await page.locator('.picked-bar').getByRole('button', { name: 'Arkivér', exact: true }).click(); await page.waitForTimeout(900); // Væk fra listen, og ikke i papirkurven: arkivering er ikke sletning. diff --git a/web/src/routes/noter/+page.svelte b/web/src/routes/noter/+page.svelte index 6d9f41b..2d6e26d 100644 --- a/web/src/routes/noter/+page.svelte +++ b/web/src/routes/noter/+page.svelte @@ -1036,6 +1036,12 @@ {#if ownsSelected} + + {/if}