You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #3607. Shares the review.visual.gittensory.yml namespace with #3609 (preview-URL config) —
design these together as one coherent config surface, not two disconnected knobs.
Motivation
mapFilesToRoutes (src/review/visual/capture.ts) hardcodes DEFAULT_ROUTE_FILE = /apps\/gittensory-ui\/src\/routes\/(.+?)\.(?:tsx|jsx)$/i and TanStack Router's file-based routing conventions (flat .-separated segments, _-prefixed pathless layouts, (group) route groups, $param dynamic segments). This only works for gittensory's own UI.
isVisualPath (src/review/visual/paths.ts), by contrast, is already mostly repo-generic — 2 of its 3 patterns (public/**, and the .tsx/.jsx/.css/.scss/.sass/.less/.html/.svg/.astro/.vue/.svelte/.mdx extension list) aren't gittensory-specific, so metagraphed's apps/ui/src/routes/*.tsx files already correctly classify as visual. Only the file-to-route MAPPING step needs generalizing.
Zero-config must still produce something useful.DEFAULT_ROUTES = ["/"] is already the fallback when no route-file pattern matches — keep that: a repo that configures nothing still gets a real homepage before/after, it just won't get smart per-route targeting until it opts in.
Requirements
Add review.visual.routes to the shared .gittensory.yml config block (see Generic per-repo preview-URL provider config (Cloudflare/Vercel/Netlify/manual template) #3609): either a route-file
pattern + transform (for repos with conventional file-based routing), or — simpler and more robust for a
first cut — an explicit list of routes to always screenshot, for repos with unusual/non-file-based routing.
Absent config stays byte-identical to today: gittensory-ui's own hardcoded pattern remains its default
(or moves to being ITS OWN explicit config using the same mechanism, for consistency — either is fine as
long as behavior doesn't change).
Identify metagraphed's actual apps/ui routing convention (check its router setup — do not assume it
matches gittensory-ui's TanStack conventions) and configure it as the first real non-gittensory usage —
an explicit fixed route list is an acceptable, even preferable, first cut if its conventions don't
cleanly generalize to a pattern.
Make MAX_ROUTES (currently a hardcoded 2) a per-repo-overridable cap, not just a global constant.
mapFilesToRoutes accepts the resolved per-repo config instead of only the hardcoded default
metagraphed's apps/ui routing convention identified and either mapped or explicitly configured
Tests: default behavior unchanged (byte-identical), a pattern-configured repo maps correctly, an
explicit fixed-route-list repo always screenshots those routes regardless of changed files
.gittensory.yml.example documents the new knob with a generic (non-metagraphed-specific) example
Expected outcome
Any repo — not just gittensory's own UI — can get sensible before/after screenshots of the routes its PRs
actually touch, with zero config required to get a basic homepage shot and a few lines of YAML for real
per-route targeting.
Effort
M — a new config-as-code knob (well-established pattern in this codebase) plus the metagraphed
route-convention investigation.
Part of #3607. Shares the
review.visual.gittensory.ymlnamespace with #3609 (preview-URL config) —design these together as one coherent config surface, not two disconnected knobs.
Motivation
mapFilesToRoutes(src/review/visual/capture.ts) hardcodesDEFAULT_ROUTE_FILE = /apps\/gittensory-ui\/src\/routes\/(.+?)\.(?:tsx|jsx)$/iand TanStack Router's file-based routing conventions (flat.-separated segments,_-prefixed pathless layouts,(group)route groups,$paramdynamic segments). This only works for gittensory's own UI.isVisualPath(src/review/visual/paths.ts), by contrast, is already mostly repo-generic — 2 of its 3 patterns (public/**, and the.tsx/.jsx/.css/.scss/.sass/.less/.html/.svg/.astro/.vue/.svelte/.mdxextension list) aren't gittensory-specific, so metagraphed'sapps/ui/src/routes/*.tsxfiles already correctly classify as visual. Only the file-to-route MAPPING step needs generalizing.Zero-config must still produce something useful.
DEFAULT_ROUTES = ["/"]is already the fallback when no route-file pattern matches — keep that: a repo that configures nothing still gets a real homepage before/after, it just won't get smart per-route targeting until it opts in.Requirements
review.visual.routesto the shared.gittensory.ymlconfig block (see Generic per-repo preview-URL provider config (Cloudflare/Vercel/Netlify/manual template) #3609): either a route-filepattern + transform (for repos with conventional file-based routing), or — simpler and more robust for a
first cut — an explicit list of routes to always screenshot, for repos with unusual/non-file-based routing.
(or moves to being ITS OWN explicit config using the same mechanism, for consistency — either is fine as
long as behavior doesn't change).
apps/uirouting convention (check its router setup — do not assume itmatches gittensory-ui's TanStack conventions) and configure it as the first real non-gittensory usage —
an explicit fixed route list is an acceptable, even preferable, first cut if its conventions don't
cleanly generalize to a pattern.
MAX_ROUTES(currently a hardcoded 2) a per-repo-overridable cap, not just a global constant.Deliverables
review.visual.routesschema + parser + resolver (same PR/pattern as Generic per-repo preview-URL provider config (Cloudflare/Vercel/Netlify/manual template) #3609'sreview.visual.previewif convenient — one config parser for the whole
review.visualblock)mapFilesToRoutesaccepts the resolved per-repo config instead of only the hardcoded defaultapps/uirouting convention identified and either mapped or explicitly configuredexplicit fixed-route-list repo always screenshots those routes regardless of changed files
.gittensory.yml.exampledocuments the new knob with a generic (non-metagraphed-specific) exampleExpected outcome
Any repo — not just gittensory's own UI — can get sensible before/after screenshots of the routes its PRs
actually touch, with zero config required to get a basic homepage shot and a few lines of YAML for real
per-route targeting.
Effort
M — a new config-as-code knob (well-established pattern in this codebase) plus the metagraphed
route-convention investigation.