RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/photoprism/photoprism

AGENTS.md

frontend/AGENTS.md
AGENTS.md

Quality

76/100

Scores the file, not the repository.

Length

896 words

8 headings · 0 code blocks

Repository

40k

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
photoprism/photoprism/frontend/AGENTS.mdRawGitHub
1# Frontend Guidelines
2 
3**Last Updated:** July 28, 2026
4 
5## Dependencies & Pins
6 
7- [`frontend/README.md`](README.md) is the canonical doc for dependency pin rationale, the `overrides` layer, ESM-only upgrade blockers, and the orphan-audit pattern.
8- **Pins are intentional.** When a version has no caret (e.g., `"axios": "1.17.0"`, `"vuetify": "3.12.2"`), check `frontend/README.md` and `git log -p -S "<pkg>" -- frontend/package.json` for the reason before changing it.
9- npm is a workspace; run `npm install --ignore-scripts --no-audit --no-fund --no-update-notifier` from the **repo root** (not `frontend/`) so the root `package-lock.json` updates.
10- After dep changes run `make audit`, `make build-js`, `make test-js`, and `make notice`.
11- Before adding a new dep — and especially before declaring an existing one "unused" — verify with `rg -nF "<pkg>" frontend …` plus `npm ls <pkg> --all` that no consumer or peer-dep needs it.
12 
13## Frontend Linting & Test Entry Points
14 
15- Run `make -C frontend help` for an overview of the most common frontend targets, and `make -C frontend list` to see all of them.
16- Use the lint and format scripts declared in `frontend/package.json`; all added JS, Vue, and frontend tests must follow those standards.
17- Frontend unit tests use Vitest. Common entry points are `make test-js`, `make vitest-watch`, and `make vitest-coverage`.
18- New JavaScript functions, including helpers, should be tested whenever practical; update existing tests or add new ones as needed.
19- New Vue components should have component-test coverage, and existing component tests should be updated as needed when component behavior changes.
20- Acceptance tests use the `acceptance-*` targets in the root `Makefile`.
21- For one-off TestCafe checks, keep startup and cleanup in the repository root: `make storage/acceptance`, `make acceptance-sqlite-restart`, `make wait-2`, then `(cd frontend && npm run testcafe -- "chrome --headless=new --use-gl=angle --use-angle=swiftshader --disable-features=LocalNetworkAccessChecks" --config-file ./testcaferc.json --test-meta mode=public,type=short,testID=components-001 "tests/acceptance")`, then `make acceptance-sqlite-stop`.
22- If a command temporarily changes into `frontend/`, return to the repository root before running `make acceptance-sqlite-stop`.
23 
24## Templates, Session Bootstrap & Browser Baseline
25 
26- HTML entry points live under `assets/templates/`; the key files are `index.gohtml`, `app.gohtml`, `app.js.gohtml`, and `splash.gohtml`.
27- Browser checks live in `assets/static/js/browser-check.js` and must load before the main bundle from `app.js.gohtml`. Do not add `defer` or `async` unless you restore guarded loading.
28- OIDC completion is bridged through `assets/templates/auth.gohtml` and must stay aligned with `frontend/src/common/session.js`, `frontend/src/common/storage.js`, and `frontend/src/page/auth/login.vue`. Preserve the `session` storage preference across the callback so `sessionStorage` logins survive redirect.
29- When touching frontend session bootstrap, verify that `frontend/src/common/session.js` resolves `storageNamespace` from the real client config shape (`window.__CONFIG__` or `config.values`), not only from simplified mocks. Include a focused test that would fail if restore fell back to `pp:root:`.
30- The loader partial is reused in `pro/assets/templates/index.gohtml`, `plus/assets/templates/index.gohtml`, and `portal/assets/templates/index.gohtml`; whenever you change `app.js.gohtml` or bundle loading, verify those files still include the shared partial.
31- Splash styles live in `frontend/src/css/splash.css`; add new splash elements there so public and private editions stay aligned.
32- Browser baseline: the `browserslist` query in `frontend/package.json` is authoritative — `.babelrc` sets no explicit `targets`, so `@babel/preset-env` compiles to that set. Resolve it with `(cd frontend && npx browserslist)` rather than quoting fixed versions, which go stale as caniuse data updates. Update the message in `assets/templates/app.js.gohtml` and matching CSS if the support matrix changes.
33 
34## Translations
35 
36- Translation extraction source of truth is the root `make gettext-extract`, which runs `scripts/gettext-extract.sh` across `frontend/src` and any available `plus`, `pro`, or `portal` overlays.
37- Compatibility targets such as `make -C plus gettext-extract` delegate to the root target.
38- Avoid punctuation-only gettext keys such as `$gettext("—")`; they create noisy entries in `frontend/src/locales/translations.pot`.
39- Case conventions: tooltips, labels, buttons, placeholders, and short imperative phrases use **Title Case** (`Zoom In`, `Toggle Thumbnails`, `Add to Album`); running prose, full sentences, and notifications use **sentence case** (`Failed to save changes`). Lowercase only articles, short conjunctions, and ≤3-letter prepositions when not first. The forced-as-is Vuetify 3 UI messages in `frontend/src/locales.js` are adopted verbatim — exempt, and not a casing reference to copy. Full rules: `specs/frontend/translations.md` §"Case Conventions".
40 
41## Focus Management
42 
43- Dialogs must follow the shared focus pattern documented in `frontend/src/common/README.md`.
44- Always expose `ref="dialog"` on `<v-dialog>` overlays, call `$view.enter` and `$view.leave` in `@after-enter` and `@after-leave`, and avoid positive `tabindex` values.
45- Persistent dialogs must handle Escape via `@keydown.esc.exact` so Vuetify's rejection animation is suppressed; keep other shortcuts on `@keyup` so inner inputs can cancel them first.
46- Global shortcuts flow through `onShortCut(ev)` in `common/view.js`; it forwards only Escape and `ctrl` or `meta` combinations.
47- When a dialog opens nested menus such as combobox suggestion lists, verify they still cooperate with the global trap.
48 
49## Playwright MCP Usage
50 
51- Default endpoint is `http://localhost:2342/`; default login routes are `/library/login` for CE, Plus, and Pro, and `/portal/login` for Portal.
52- Use the local compose admin credentials; if login fails, inspect the active compose environment.
53- Desktop sessions default to `1280x900`; mobile sessions should use the mobile Playwright server with `375x667`.
54- Close the browser tab after scripted interactions.
55- Prefer waits over sleeps, click only visible and enabled elements, and use role, label, or text selectors instead of brittle XPath selectors.
56- Keep screenshots small and reproducible: prefer JPEG, visible viewport, deterministic `.local/screenshots/<case>/<step>__<viewport>.jpg` names, and no large inline screenshots.
57- If `npx` fetches an MCP server at runtime, add `--yes` or preinstall it to avoid prompts.
58 
59## Frontend Test Gotchas
60 
61- Hidden-route UI checks under `/library/hidden` or `/portal/hidden` require both `files.file_error` and `photos.photo_quality = -1`; `file_error` alone will not surface the row.
62 

Commands it names

  • git log -p -S "<pkg>" -- frontend/package.json
  • npm install --ignore-scripts --no-audit --no-fund --no-update-notifier
  • make audit
  • make build-js
  • make test-js
  • make notice
  • npm ls <pkg> --all
  • make -C frontend help
  • make -C frontend list
  • make vitest-watch
  • make vitest-coverage
  • make storage/acceptance
  • make acceptance-sqlite-restart
  • make wait-2
  • make acceptance-sqlite-stop
  • make gettext-extract
  • make -C plus gettext-extract
  • npx

Sections

  • Frontend Guidelines
  • Dependencies & Pins
  • Frontend Linting & Test Entry Points
  • Templates, Session Bootstrap & Browser Baseline
  • Translations
  • Focus Management
  • Playwright MCP Usage
  • Frontend Test Gotchas

What it covers

setuptestcode-styletesting-strategydependencies

Stack — with the evidence

go

(1.00)

vitest

(1.00)

eslint

(1.00)

ai-agent

(0.90)

vue

(0.70)

vite

(0.70)

javascript

(0.60)

docker

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
photoprism
Language
—
License
—
Archived
no

All configs in this repo

Also in photoprism/photoprism

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
photoprism/photoprisminternal/config/AGENTS.md · 40kAGENTS.mdgoeslint+7databasedo-not46/1002 days ago
photoprism/photoprisminternal/entity/migrate/AGENTS.md · 40kAGENTS.mdgoeslint+7testtesting-strategydatabase63/1002 days ago
photoprism/photoprisminternal/photoprism/AGENTS.md · 40kAGENTS.mdgoeslint+7no sections39/1002 days ago
photoprism/photoprisminternal/service/cluster/AGENTS.md · 40kAGENTS.mdgoeslint+7buildtestapi76/1002 days ago
photoprism/photoprismpkg/AGENTS.md · 40kAGENTS.mdgoeslint+7teststylesecurity55/1002 days ago
photoprism/photoprisminternal/commands/AGENTS.md · 40kAGENTS.mdgoeslint+7teststyle66/1002 days ago
photoprism/photoprism.claude/CLAUDE.md · 40kCLAUDE.mdgoeslint+7buildtestlint-formatstyle+796/1002 days ago
photoprism/photoprism.github/copilot-instructions.md · 40kCopilot instructionsgoeslint+7buildtestlint-formatstyle+590/1002 days ago
photoprism/photoprism.github/instructions/backend.instructions.md · 40kCopilot instructionsgoeslint+7testlint-formatstyletypes+483/1002 days ago
photoprism/photoprism.github/instructions/frontend.instructions.md · 40kCopilot instructionsgoeslint+7testlint-formatstyleagent-behaviour76/1002 days ago
photoprism/photoprismAGENTS.md · 40kAGENTS.mdgoeslint+8setupbuildtestlint-format+882/1002 days ago
photoprism/photoprisminternal/AGENTS.md · 40kAGENTS.mdgoeslint+7teststyletesting-strategy71/1002 days ago
photoprism/photoprisminternal/api/AGENTS.md · 40kAGENTS.mdgoeslint+7teststyletesting-strategyapi62/1002 days ago
Diff against internal/config/AGENTS.md Diff against internal/entity/migrate/AGENTS.md Diff against internal/photoprism/AGENTS.md Diff against internal/service/cluster/AGENTS.md Diff against pkg/AGENTS.md Diff against internal/commands/AGENTS.md Diff against .claude/CLAUDE.md Diff against .github/copilot-instructions.md Diff against .github/instructions/backend.instructions.md Diff against .github/instructions/frontend.instructions.md Diff against AGENTS.md Diff against internal/AGENTS.md Diff against internal/api/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67kAGENTS.mdtypescriptbun+10setupbuildtestlint-format+6100/1002 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/1003 days ago
ethereum/go-ethereumAGENTS.md · 51kAGENTS.mdgodocker+1buildtestlint-formatgit+1100/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack