fix(files): review round 1, the page — honest states, the keyboard, the tray's words

- A library past the list's cap is searched and sorted on the server; the count says "the newest".
- Each folder and each search opens on its first page (DataTable pageScope, useCardPager scope).
- A file dropped where the page takes none never reaches the browser (which would unload the app).
- The viewer's arrows wait while a layer opened from it is on top, and scroll a wide text line;
  a text shows its first 5000 lines and says where the rest is.
- Confirms name the file (no more "your downloads"); the asking menu rows end in "…".
- The tray names a running step beside its bar, shows a pause mark for paused work, polls slowly
  while only paused work waits, and forgets a finished file that was deleted.
- An unchanged rename sends nothing; a paste opens the download dialog only with nothing on top;
  the link box never replaces what was typed.
- Honest states: folders that failed to load, a file no longer there, the storage figure; the rail
  says "nothing downloaded" only when there is nothing.
- Focus after deleting the open folder and when the format form opens; the format name's label.
- ui/Meter (one danger line for both quota bars) and ui/RenameField in the platform layer.
- Copy fixes, stale comments and the speculative hub key; a contract test for the list's
  parameters; e2e: the Files page and the paste intake.
This commit is contained in:
2026-10-13 00:14:09 +02:00
parent 815083bcc4
commit 8b2260c9a8
41 changed files with 920 additions and 218 deletions
@@ -0,0 +1,31 @@
// @vitest-environment jsdom
//
// One meter for every place that shows how full a quota is: it turns to a warning at the share it
// SHOWS (the rounded percent), so the user's own rail and the admin's Storage tab never disagree
// about the same fill, and it reads as a meter with that percent.
import { afterEach, describe, expect, it } from "vitest";
import { cleanup, render, screen } from "@testing-library/react";
import { Meter } from "./Meter";
afterEach(cleanup);
const fill = () => screen.getByRole("meter").firstElementChild!;
describe("Meter", () => {
it.each([
[896, "90", true],
[894, "89", false],
[2000, "100", true],
])("%i of 1000 shows its percent and warns from 90", (value, shown, danger) => {
render(<Meter value={value} max={1000} label="Storage" />);
expect(screen.getByRole("meter", { name: "Storage" }).getAttribute("aria-valuenow")).toBe(
shown,
);
expect(fill().classList.contains("bg-danger")).toBe(danger);
});
it("an unset limit is an empty meter, never a division by zero", () => {
render(<Meter value={5} max={0} label="Storage" />);
expect(screen.getByRole("meter").getAttribute("aria-valuenow")).toBe("0");
});
});