Skip to content

refactor: simplification pass - #31

Merged
thisispivi merged 7 commits into
trips-v2from
refactor/simplify-pass
Oct 4, 2026
Merged

thisispivi merged 7 commits into
trips-v2from
refactor/simplify-pass

Conversation

@thisispivi

Copy link
Copy Markdown
Owner

Simplification pass on top of trips-v2. Behaviour is unchanged except where noted.

Changes

  • One copy of the world polygons. The editor had a line-for-line copy of the app's topology conversion and antimeridian split. Both apps now import features/map/lib/countries.ts, which has no dataset imports. The editor drops topojson-client.
  • Fewer aliases. The editor's data/ re-exported core types and renamed TransportModeSchema.options, and worldCountries.ts carried an exact copy of toId. Consumers now import the originals.
  • One animation library. react-transition-group drove two fades in FilterByCountry; those now use framer-motion like the rest of the app. A root MotionConfig makes all framer-motion animation honour prefers-reduced-motion (behaviour change, intended).
  • Scripts. Removed app scripts that duplicated others (check, doctor, knip:fix, --host).
  • Docs. Fifteen placeholder JSDoc summaries now describe what the code does, and stale guideline text about lazy routes is fixed.

Left alone on purpose

  • Per-tag JSDoc stays. The coding guidelines require it and lint enforces it.
  • The trip migration CLI and the Python uploader stay. Forks need the first; retiring the second needs a separate decision.
  • mobile-device-detect stays: stable, and a hand-rolled user-agent check would be worse.

Verification

  • pnpm check and pnpm build pass, via the pre-push hook.
  • Uploader compileall and its unit tests pass.
  • Built-in browser: the country filter opens with all 20 options and closes on Escape. The pane runs no animation frames, so the fade itself still needs a look in a real browser.

The editor kept a line-for-line copy of the app's topology conversion and
antimeridian split. The polygons now live in a dataset-free module both
apps import.
siteConfig.ts re-exported core types, dataset.ts renamed
TransportModeSchema.options, and worldCountries.ts carried an exact copy
of toId. Consumers now import the originals.
Fifteen summaries only restated the name ("Opens trip.", "Represents a
places filter."), which the coding guidelines treat as missing
documentation.
react-transition-group drove two fades in one component while the rest
of the app animates with framer-motion. Dropping it removes a dependency,
its types, and the transition class CSS. A root MotionConfig makes every
framer-motion animation honour prefers-reduced-motion, which the global
CSS rule cannot reach.
check repeated the root check, doctor repeated react:doctor, knip:fix was
unused, and dev's --host repeated server.host in vite.config.ts.
Lazy views are router lazy routes in app/routing/router.tsx, not
React.lazy calls in main.tsx, and they import named exports, so the
default-export exception the guidelines described no longer exists.
The editor no longer converts the topology itself; the shared module
resolves topojson-client from the public app's dependencies.
@thisispivi
thisispivi merged commit 6d07313 into trips-v2 Oct 4, 2026
1 check passed
@thisispivi
thisispivi deleted the refactor/simplify-pass branch October 4, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant