Skip to content

Commit bc097c9

Browse files
adulbrichclaude
andauthored
Name the routes after the pages, not after their position in the app (#258)
`/home-page` and `/settings-page` described where a page sat rather than what it did, and `-page` on a route is a suffix that never earns its keep. The generator route becomes `/pipeline`, which is the word the code already uses everywhere around it (`src/lib/pipeline`, `(pipeline-configuration)`, `pipeline-config-store.ts`, `run-wasm-pipeline.ts`). `/image-viewer` loses the `image-` it shared with nothing else and becomes `/viewer`. /home-page -> /pipeline /settings-page -> /settings /image-viewer -> /viewer (and /image-viewer/view -> /viewer/view) In the App Router a directory is both the URL and the import path, so each rename moves two namespaces at once. The build catches a stale import; it does not catch a stale route string, since `typedRoutes` is off. Three references live outside anything that would have failed: - `.github/workflows/ci-web.yml` asserts `out/<route>.html` after a build, so a stale path stays green locally and breaks only in CI. - `biome.jsonc` keys two lint overrides by file path -- one working around a Biome crash, one preserving bare import specifiers. Stale paths would have stopped applying without a word. - `src-tauri/tauri.conf.json` sets the window's opening URL, which no test in the repo exercises. `id="image-viewer-input"` keeps its name: it is a DOM id the desktop e2e spec selects on, not a route. The "Image Generator" nav label is likewise untouched, being copy rather than a path. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ced3db7 commit bc097c9

76 files changed

Lines changed: 91 additions & 96 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# first thing a visitor sees and the last thing a build log mentions.
103103
run: |
104104
test -f out/index.html
105-
test -f out/home-page.html
105+
test -f out/pipeline.html
106106
test -f out/wasm/versions.json
107107
test -f out/wasm/hdrgen.wasm
108108

DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Serve `out/` as static files. The only requirements are the `.wasm` MIME type
3232
above and clean-URL handling, which almost every static host does.
3333

3434
For a quick local check, note that Python's `http.server` does **not** map
35-
`/home-page` to `home-page.html`, so use the `.html` paths or a server that
35+
`/pipeline` to `pipeline.html`, so use the `.html` paths or a server that
3636
does:
3737

3838
```sh

PRD.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Four tabs (`src/app/navigation.tsx`), identical in both hosts:
1818

1919
| Tab | Route | Purpose |
2020
|---|---|---|
21-
| Image Generator | `/home-page` | Configure and run the LDR → HDR calibration pipeline |
22-
| Settings | `/settings-page` | Output folder, and the versions of everything bundled |
21+
| Image Generator | `/pipeline` | Configure and run the LDR → HDR calibration pipeline |
22+
| Settings | `/settings` | Output folder, and the versions of everything bundled |
2323
| Runs | `/runs` | History of previous pipeline runs and their outcomes |
24-
| Image Viewer | `/image-viewer`, `/image-viewer/view` | Load and inspect a generated `.hdr` file |
24+
| Image Viewer | `/viewer`, `/viewer/view` | Load and inspect a generated `.hdr` file |
2525

26-
`/` redirects to `/home-page`, so the site root resolves in a browser.
26+
`/` redirects to `/pipeline`, so the site root resolves in a browser.
2727

2828
## 3. Feature: Image Generator (Home Page)
2929

30-
`src/app/home-page/page.tsx`
30+
`src/app/pipeline/page.tsx`
3131

3232
- **Image set input** — drag-and-drop or file-picker selection of an LDR bracket (JPEG, TIFF, or camera raw). Multiple named image sets can be staged; each set is validated to contain at least 2 images, and every staged set is run. On the desktop a set is a directory; in a browser, `webkitdirectory` reports a relative path, so nested folders still become separate sets and a plain multi-file selection becomes one.
3333
- **Camera response function** — upload of a `.rsp` file describing the camera's tone response, required for JPEG-derived input.
@@ -48,7 +48,7 @@ Four tabs (`src/app/navigation.tsx`), identical in both hosts:
4848

4949
## 4. Feature: Calibration Pipeline
5050

51-
`src/lib/pipeline/*`, driven from `src/app/home-page/run-wasm-pipeline.ts`
51+
`src/lib/pipeline/*`, driven from `src/app/pipeline/run-wasm-pipeline.ts`
5252

5353
The pipeline is TypeScript orchestrating WebAssembly. It runs **in a Web Worker**, not on the page: Emscripten's `callMain` is synchronous and blocks its thread for the whole of a tool, so an inline pipeline froze the tab for the length of an hdrgen merge. The worker reads no files itself — the page stages the bytes and transfers them in, because only the page knows how to reach a file (Tauri's filesystem on the desktop, the virtual filesystem in a browser), and keeping that out of the worker is what lets one worker serve both hosts.
5454

@@ -79,7 +79,7 @@ The two former Rust commands have TypeScript equivalents: raw conversion rides o
7979

8080
## 5. Feature: Image Viewer
8181

82-
`src/app/image-viewer/*`
82+
`src/app/viewer/*`
8383

8484
- **File intake** — drag-and-drop or file picker for a single `.hdr` file (extension-validated); state is passed to the viewer route via a serialized URL query string (`viewer-url.ts`).
8585
- **Rendering** — a `three.js` (WebGL) canvas renders the HDR pixel data as a texture, with pan/zoom (`react-zoom-pan-pinch`).
@@ -96,7 +96,7 @@ The viewer works on every platform with no additional software. It requires WebG
9696

9797
## 6. Feature: Settings
9898

99-
`src/app/settings-page/page.tsx`
99+
`src/app/settings/page.tsx`
100100

101101
- Output folder, on the desktop. It is hidden in a browser, because a browser downloads and the browser chooses where — an output path there would be a control that does nothing (`canWriteToChosenDirectory()`).
102102
- There are no tool paths to configure: every tool ships with the app.

__tests__/build-pipeline-params.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "@jest/globals";
2-
import type { pipelineConfig } from "../src/app/home-page/(pipeline-configuration)/config-provider";
3-
import { buildPipelineParams } from "../src/app/home-page/build-pipeline-params";
2+
import type { pipelineConfig } from "../src/app/pipeline/(pipeline-configuration)/config-provider";
3+
import { buildPipelineParams } from "../src/app/pipeline/build-pipeline-params";
44

55
const settings = {
66
dcrawEmuPath: "/tools/dcraw",

__tests__/calibration-files.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "@jest/globals";
2-
import type { pipelineConfig } from "@/app/home-page/(pipeline-configuration)/config-provider";
3-
import { unsuppliedCalibrationFiles } from "@/app/home-page/calibration-files";
2+
import type { pipelineConfig } from "@/app/pipeline/(pipeline-configuration)/config-provider";
3+
import { unsuppliedCalibrationFiles } from "@/app/pipeline/calibration-files";
44

55
/** The form's own defaults: every calibration field starts empty. */
66
function makeConfig(overrides: Partial<pipelineConfig> = {}): pipelineConfig {

__tests__/hdr-metadata-priority.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "@jest/globals";
22
import { render, screen } from "@testing-library/react";
3-
import { HdrMetadataDetails } from "../src/app/image-viewer/view/illuminance-details";
3+
import { HdrMetadataDetails } from "../src/app/viewer/view/illuminance-details";
44

55
const KEY_LABEL_REGEX = /^(CAPDATE|COMPUTED_VERTICAL_ILLUMINANCE|FORMAT|VIEW)$/;
66

__tests__/image-matrix-lock.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jest.mock("@tauri-apps/plugin-fs", () => ({
1919
stat: () => Promise.resolve({ isDirectory: false, isFile: true, size: 1024 }),
2020
}));
2121

22-
import { SelectedImageProvider } from "../src/app/home-page/selected-image-context";
22+
import { SelectedImageProvider } from "../src/app/pipeline/selected-image-context";
2323
import {
2424
ImageMatrixInput,
2525
type ImageSetIssue,

__tests__/image-matrix-selection-clear.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jest.mock("@tauri-apps/plugin-fs", () => ({
1515
import {
1616
SelectedImageProvider,
1717
useSelectedImage,
18-
} from "../src/app/home-page/selected-image-context";
18+
} from "../src/app/pipeline/selected-image-context";
1919
import { ImageMatrixInput } from "../src/components/ui/image-matrix-input";
2020
import type { ImageSet } from "../src/components/ui/image-set-preview";
2121
import { TooltipProvider } from "../src/components/ui/tooltip";

__tests__/lens-mask-editor.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare const jest: typeof import("@jest/globals").jest;
1313

1414
const DIALOG_TITLE = /Configure lens mask/;
1515

16-
import { LensMaskEditor } from "../src/app/home-page/lens-mask-editor";
16+
import { LensMaskEditor } from "../src/app/pipeline/lens-mask-editor";
1717

1818
describe("LensMaskEditor", () => {
1919
it("edits the same motion values as the inline preview", async () => {

__tests__/lens-mask-fit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "@jest/globals";
2-
import { describeMaskOverflow } from "@/app/home-page/lens-mask-fit";
2+
import { describeMaskOverflow } from "@/app/pipeline/lens-mask-fit";
33

44
// The dimensions dcraw_emu produces for the example Canon 5D Mark III CR2s,
55
// and therefore the dimensions of the merged picture crop is handed.

0 commit comments

Comments
 (0)