Skip to content
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ country and whether an album has reviews.

IT2810 (NTNU) Project 2. Group T19: `erikhfj`, `robertky`, `evenkkl`, `rachelks`.

| | |
| ------------------- | -------------------------------------------------------- |
| Current milestone | **M4 – final prototype and test suite**, due 13 November |
| Live prototype | http://it2810-19.idi.ntnu.no/project2 |
| Architecture / ADRs | [`docs/architecture.md`](docs/architecture.md) |
| Data model | [`docs/data-model.md`](docs/data-model.md) |
| UI specification | [`docs/ui-specification.md`](docs/ui-specification.md) |
| Scalability | [`docs/scalability.md`](docs/scalability.md) |
| Workflow | [`docs/WORKFLOW.md`](docs/WORKFLOW.md) |
| AI usage log | [`docs/AI-USAGE.md`](docs/AI-USAGE.md) |
| Running on the VM | [`docs/VM-setup.md`](docs/VM-setup.md) |
| | |
| ------------------- | ---------------------------------------------------------- |
| Current milestone | **M4 delivered – final polish**, final hand-in 27 November |
| Live prototype | http://it2810-19.idi.ntnu.no/project2 |
| Architecture / ADRs | [`docs/architecture.md`](docs/architecture.md) |
| Data model | [`docs/data-model.md`](docs/data-model.md) |
| UI specification | [`docs/ui-specification.md`](docs/ui-specification.md) |
| Scalability | [`docs/scalability.md`](docs/scalability.md) |
| Workflow | [`docs/WORKFLOW.md`](docs/WORKFLOW.md) |
| AI usage log | [`docs/AI-USAGE.md`](docs/AI-USAGE.md) |
| Running on the VM | [`docs/VM-setup.md`](docs/VM-setup.md) |

## Screenshots

Expand Down Expand Up @@ -311,17 +311,22 @@ We consider sustainability through design choices that reduce unnecessary data t
| Bundle budget in CI | CI fails before a dependency quietly doubles the payload | 512 000 bytes per JS chunk |
| Indexed prefix search | Uses the existing GIN index, but broad prefixes require more database processing | Better search flexibility, but potentially higher query costs for broad prefixes |

**Bundle size**, production build measured 26 October 2026:
**Bundle size**, production build measured 17 November 2026:

| File | Raw | Gzip |
| ----------------------- | --------: | --------: |
| `index-*.js` | 430.26 kB | 131.10 kB |
| `index-*.css` | 4.99 kB | 1.77 kB |
| `AlbumDetailPage-*.js` | 8.29 kB | 2.88 kB |
| `AlbumDetailPage-*.css` | 1.94 kB | 0.71 kB |
| `index.html` | 0.51 kB | 0.31 kB |

The two `AlbumDetailPage` rows represent the separate chunks for the album detail route and are not part of the search page payload. Opening an album uses normal page navigation, while previously downloaded assets may be reused by the browser. Artwork is fetched separately from Cover Art Archive and is not included in these bundle sizes. Browser-native responsive images (`srcSet`/`sizes`) let the browser select an appropriate image size; card images load lazily, while detail artwork loads eagerly.
| `index-*.js` | 385.45 kB | 118.62 kB |
| `index-*.css` | 13.32 kB | 3.73 kB |
| `AlbumCover-*.js` | 52.14 kB | 13.50 kB |
| `AlbumCover-*.css` | 4.17 kB | 1.29 kB |
| `AlbumDetailPage-*.js` | 10.31 kB | 3.49 kB |
| `AlbumDetailPage-*.css` | 5.58 kB | 1.48 kB |
| `CratePage-*.js` | 2.32 kB | 0.99 kB |
| `CratePage-*.css` | 0.23 kB | 0.16 kB |
| `rolldown-runtime-*.js` | 0.58 kB | 0.36 kB |
| `index.html` | 0.78 kB | 0.38 kB |

`AlbumDetailPage` and `CratePage` are code-split into separate lazy-loaded route chunks, so neither is loaded until the user opens an album or visits Your crate (and `AlbumCover` is shared across the views that render covers). Opening an album or crate page uses normal page navigation, while previously downloaded assets may be reused by the browser. Artwork is fetched separately from Cover Art Archive and is not included in these bundle sizes. Browser-native responsive images (`srcSet`/`sizes`) let the browser select an appropriate image size; card images load lazily, while detail artwork loads eagerly.

**Requests for a typical search:** An uncached search initially fetches up to 20 albums in one `searchAlbums` request. Infinite scroll loads up to two additional pages automatically, while further pages are loaded using the Load more button. Previously fetched pages are reused from Apollo's cache without new GraphQL requests. No search requests are sent while the user types. Album artwork adds separate external image requests as cards approach the viewport.

Expand Down
10 changes: 10 additions & 0 deletions docs/AI-USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,18 @@ the part that matters most.
| 2026-11-13 | rachelks | Codex (ChatGPT) | Assisted with #24 frontend integration, dropdown keyboard navigation, accessibility and tests, as well as debugging React/Apollo warnings and simplifying the SearchForm/DiscoveryPage responsibilities. All changes were thoroughly reviewed and tested before committing. |
| 2026-11-13 | robertky | Codex (ChatGPT) | Assisted me with #26: polished the README, added screenshots and project-document links, and verified the local setup from a clean clone. I reviewed the changes and updated the implementation notes to reflect merged browsing and country-filter features. |
| 2026-11-17 | erikhfj | Antigravity | #91, E2E search helper fix: updated `e2e/tests/search.spec.ts` to match the `Search` and `Filters` buttons with `exact: true` so `Clear recent searches` does not trigger a strict-mode violation, and cleared `E2E_USER_ID`'s recorded search history during cleanup. Verified locally with two consecutive full `pnpm test:e2e` runs against a throwaway seeded PostgreSQL stack. |
| 2026-11-17 | erikhfj | Antigravity | #93, removed the trailing U+FFFD replacement character from the `SearchForm` placeholder and added a regression test in `SearchForm.test.tsx`. Verified with `pnpm format:check && pnpm lint && pnpm typecheck && pnpm test`. |
| 2026-11-17 | erikhfj | Antigravity | #97, documented how `AGENTS.md`, `schema.graphql`, and issue specs are used as shared context in AI prompts, added recent log rows, and updated `README.md` status and bundle measurements after running `pnpm build`. |
| 2026-11-20 | erikhfj | Antigravity | #100, review author privacy: removed `User.id` from `schema.graphql` and the `AlbumDetail` query, replaced `Listener <uuid-prefix>` with deterministic SHA-256 music pseudonyms in `server/src/userIdentity.ts` (including read-time sanitization of legacy labels in `Review.user`), added `User` cache merge policy, and updated schema/unit/client tests and `docs/architecture.md`. Verified with `pnpm codegen`, `pnpm format:check`, `pnpm lint`, `pnpm typecheck`, `pnpm test`, and `pnpm build`. |

## Shared context and prompting

To keep AI-assisted changes consistent across four contributors and multiple tools (`opencode`, `Codex (ChatGPT)`, `Claude`, and `Antigravity`), the repository carries its own shared context:

- **`AGENTS.md`** acts as the shared harness: it states the non-negotiable architecture rules (SQL sorting/filtering, keyset pagination, per-request DataLoaders, parameterised queries, `X-User-Id` context, plain CSS, accessibility, URL search state), conventions, and verification commands. Repo-aware CLI/IDE agents load it automatically, and we reference the same rules when working in chat tools.
- **`schema.graphql` and `docs/`** (`architecture.md`, `data-model.md`, `ui-specification.md`, `WORKFLOW.md`) define the API contract and UI boundaries before code is written.
- **How tasks were scoped and prompted:** Instead of asking for open-ended features, prompts started from an individual GitHub issue and its acceptance criteria, pointed to the relevant files and `schema.graphql` contract, and required running `pnpm format:check && pnpm lint && pnpm typecheck && pnpm test` (plus PostgreSQL/Playwright/Lighthouse checks when relevant) to verify behavior rather than accepting the first output.

## Notes

- The prototype was never merged. `archive/scaffold-prototype` is a reference to
Expand Down