Skip to content

Refactoring 2026-08 - #81

Merged
davidaugustat merged 40 commits into
masterfrom
refactoring-2026-08
Sep 6, 2026
Merged

davidaugustat merged 40 commits into
masterfrom
refactoring-2026-08

Conversation

@davidaugustat

@davidaugustat davidaugustat commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

The architecture of the project was heavily refactored to make it more state-of-the-art. However, from a user perspective nothing changed. The look-and-feel is exactly the same as before.

The following things were changed:

  • Migrate project from Webpack to Nuxt
  • Upgrade to Bootstrap 5
  • Bundle all dependencies with the project instead of loading them from static.davidaugustat.com
  • Create a test suite with logic tests and UI tests (Playwright)
  • Create a CI/CD pipeline with automatic building, testing, linting and deployment

The math engine itself was not changed (except for some small formatting/JSDoc issues and a minor bug regarding matrix exponentiation with exponent 0).

I used Codex / GPT 5.6 Sol for large parts of the refactoring. However, I reviewed and tested all the code manually too.

davidaugustat and others added 30 commits August 9, 2026 16:41
AI-generated PR feedback was:
- `CalculatorForm.vue:129-179` manipulates `window.history` directly and installs its own `popstate` listener. Vue Router therefore does not know when calculator query parameters change; `useRoute().query` can remain stale. It works today because nothing else observes the query, but it creates two sources of truth. Prefer `useRouter().push()` and watching `useRoute().query`.

- Internal navigation still uses ordinary `<a>` elements in `SiteHeader.vue`, `SiteFooter.vue`, and the content components. Consequently, every navigation performs a full reload and bypasses NuxtLink prefetching/client routing. Using `<NuxtLink>` would make this a more idiomatic Nuxt migration. Matomo would then need route-change tracking.

- `CalculatorForm.vue` is becoming a “god component.” Its 256 lines handle calculation orchestration, result conversion, localization, analytics, clipboard access, URL synchronization, history events, KaTeX rendering, and markup. I would extract at least query synchronization and analytics into composables/utilities. Result rendering could also become separate components.

- `CalculatorForm.vue:223-249` unnecessarily uses `v-html` for LaTeX derived partly from user input. The parser currently restricts allowable characters, so I did not find an exploitable input, but this remains a fragile HTML-injection sink. Text interpolation followed by KaTeX auto-rendering would preserve escaping.

- `CalculatorForm.vue:113-120` uses the deprecated `document.execCommand("copy")` workaround. `navigator.clipboard.writeText()` should be primary, with the textarea approach only as a compatibility fallback.

- `site.js:3` uses `Object.freeze()` and describes the returned locale copy as immutable, but the freeze is shallow; nested objects and `fieldOptions` arrays remain mutable. Either deep-freeze it or avoid claiming immutability.

- Each non-class JavaScript or Vue file needs file-level JSDoc with an `@file` tag explaining what this file is for.
Can't believe this was wrong for all these years. I'm sorry to all the students I might have confused.
…github-pipeline

68 create test cases and a GitHub pipeline
feat: add ESLint configuration and scripts for linting

chore: update Playwright configuration to include web server setup

refactor: replace hardcoded routes in sitemap generation with shared public routes

feat: create shared public routes module for consistent route management

refactor: remove global setup file for Playwright tests

test: enhance site tests with dynamic route data and additional accessibility checks

chore: simplify static server implementation for Playwright tests
davidaugustat and others added 7 commits September 5, 2026 21:08
…omatically-deploy-to-web-hosting-using-gh-actions
the long name was annoying
This workflow now also handles the deployment
Reason: GitHub uses the following format in its pipeline reports:
CI/CD / Browser tests (pull_request)

The slash in "CI/CD" makes this hard to read.
…web-hosting-using-gh-actions

75 automatically deploy to web hosting using gh actions
@davidaugustat davidaugustat linked an issue Sep 5, 2026 that may be closed by this pull request
@davidaugustat
davidaugustat merged commit 1b473b9 into master Sep 6, 2026
5 checks passed
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.

Refactoring 2026-08

1 participant