Commit Graph
43 Commits
Author SHA1 Message Date
John O'Keefe 515678f035 fix(frontend): Svelte 5 mount API and route-driven refresh
- loader action used new Component() plus $destroy, both removed in
  Svelte 5 (component_api_invalid_new crashed every refresh click
  before the reload ran); rewritten on mount/unmount with a real
  action destroy for the leaked subscription
- homecoming refresh moves off the legacy $: block, which never
  tracked the runes-backed router.location, onto the sanctioned
  onRouteLoaded callback with identical guard semantics; unused
  router import dropped so the check stays warning-free
2026-09-16 16:30:08 -04:00
John O'Keefe 59b81396f9 refactor(frontend): Svelte 5 mount API, router v5, dependency-free table
main.ts uses mount() instead of the legacy constructor. App.svelte
follows svelte-spa-router v5: the removed loc store becomes
router.location, while wrap/push/link keep their v4 call shapes.

AnimeTable.svelte drops svelte-headless-table and reimplements the
same 11 sortable columns (WebsiteLink id cells, asc/desc
indicators, click toggles through asc/desc/off) with local
$state/$derived - about 120 lines, no dependency, fully covered by
svelte-check instead of the libs view model.
2026-09-16 13:59:42 -04:00
John O'Keefe 0642163844 chore(wailsv3): migrate frontend to v3 bindings and runtime
Regenerated bindings with wails3 generate bindings (1 service, 29 methods, 25 models) into frontend/bindings/AniTrack as TypeScript; output verified byte-deterministic across regens, so it is committed like wailsjs was.

- 10 Svelte files: wailsjs/go/main/App imports -> import {App} from bindings/AniTrack with App.* call prefixes. No logic or markup changes.
- WebsiteLink.svelte: BrowserOpenURL -> Browser.OpenURL from @wailsio/runtime.
- AvatarMenu.svelte: runtime.Quit -> Application.Quit from @wailsio/runtime.
- package.json: add @wailsio/runtime pinned to 3.0.0-beta.20 (exact, matching the Go framework); lockfile updated, all deps still max in-range, majors deferred.
- Production vite build passes with the new bindings.
2026-09-13 17:10:17 -04:00
john-okeefe a16c804692 feat(ui): show per-service login status while accounts are being checked
When the app starts it verifies all three services sequentially, which
could leave the other two login controls looking idle or trigger login
actions before their real state is known. Track which service is
currently being checked and reflect it in the header:

- Add a serviceLoggingIn store (plus setServiceLoggingIn and
  isServiceLoggingIn helpers) to GlobalVariablesAndHelperFunctions.
- Have the loginTo* functions and the startup CheckIf* functions toggle
  their service in the store (seed all three at startup, clear each as
  it resolves).
- In Header, the login buttons show a spinner with 'Checking AniList' /
  'Checking MAL' / 'Checking Simkl' and are disabled while that service
  is being checked, reverting to the normal 'AniList Login' style label
  once its state is known.
- In the avatar menu, the 'Login to X' row shows a spinner with the
  matching 'Checking X' text while that service is logging in.
2026-08-29 13:13:42 -04:00
john-okeefe ae54fd20dd feat(frontend): integrate error handling into application
App.svelte:
- Import and render ErrorModal component
- Add ErrorModal to main app layout below Header

CheckIfAniListLoggedInAndLoadWatchList.svelte:
- Import error state helpers (setApiError, clearApiError)
- Wrap LoadAniListUser in try-catch with error handling
- Wrap LoadAniListWatchList in try-catch with error handling
- Update CheckIfAniListLoggedInAndLoadWatchList with error handling
- Remove old alert() calls in favor of modal system

Home.svelte:
- Import isApiDown and apiError stores
- Add conditional rendering for API down state
- Display user-friendly "API Unavailable" message when apiError is set
- Show warning icon and helpful messaging

Error handling is now fully integrated across the frontend application.
2026-03-30 20:08:34 -04:00
john-okeefe b2a8a504f3 fix: resolve syntax error in App.svelte
Fixed TypeScript compilation error caused by import statement and function declaration being on the same line.

Changes:
- Separated import statement and onMount declaration onto different lines
- Resolved svelte-preprocess type error
- File now compiles correctly

This was a typo from previous commit where the loc import line was incorrectly merged with the existing onMount function declaration.
2026-03-21 13:28:33 -04:00
john-okeefe 8a8baf7f8f feat: implement smart watchlist refresh on navigation
Added intelligent watchlist refresh mechanism that only refetches data when changes are actually made, preventing unnecessary API calls and improving performance.

Changes:
- Added watchlistNeedsRefresh store to track when watchlist data has changed
- Implemented reactive watcher in App.svelte that uses svelte-spa-router's loc store to detect navigation to home
- Set dirty flag in Anime.svelte after successful status updates and entry deletions
- Added conditional refresh logic that checks user's primary service (AniList, MAL, or Simkl)
- Parallel refresh support for multiple services when logged in

This resolves the issue where clicking the logo would cause full page reloads and unnecessary re-authentication checks, while also ensuring watchlist data stays current when users make changes.

Technical details:
- Uses $loc.location to detect route changes
- IIFE pattern for async operations in reactive statements
- Only refreshes for logged-in primary services
- Flag resets after successful refresh

Related to: Header.svelte client-side routing fix
2026-03-21 13:25:43 -04:00
john-okeefe 7960f8e26d removed unused imports 2025-12-23 23:33:25 -05:00
john-okeefe 2e5a4a4493 finally fixed being able to reload the anime page when searching or changing the url 2025-12-21 13:01:51 -05:00
john-okeefe 063c5016f3 fixed MAL not auto logging in when app starts 2025-12-21 00:24:25 -05:00
john-okeefe 77dc48fcf2 removed unnecessary println and console.log 2024-09-18 14:10:49 -04:00
john-okeefe be6c3439ca made function name clearer to it's intended purpose 2024-09-14 23:57:25 -04:00
john-okeefe 60a38ff569 improved loading for change individual anime from search 2024-09-09 12:03:46 -04:00
john-okeefe 908325628f Fixed components to reload watchlist 2024-09-07 21:13:15 -04:00
john-okeefe 77e361b5b2 rewrote the Anime.svelte to move out helper functions and clean up code 2024-09-05 15:29:42 -04:00
john-okeefe aeec8f79b2 fixed search dialog opening anime 2024-09-04 12:26:26 -04:00
john-okeefe f5001cff04 changed from modal to client-side router 2024-09-04 12:05:41 -04:00
john-okeefe 4d9012b43c Fixed Simkl Bugs 2024-08-18 17:23:09 -04:00
john-okeefe 76ea4f73ec created a spinner for open anime 2024-08-16 15:46:51 -04:00
john-okeefe fb2d5fbdea added ability to get anime as needed from MAL 2024-08-16 15:07:06 -04:00
john-okeefe 22ff290a81 added getting MAL watchlist 2024-08-15 21:27:31 -04:00
john-okeefe f9c6f4b827 created a responsive pagination system 2024-08-15 20:06:49 -04:00
john-okeefe a0e193e343 fixed frontend login updating 2024-08-13 19:36:39 -04:00
john-okeefe fa3304db92 added MAL Login 2024-08-13 18:54:27 -04:00
john-okeefe 43a054ac92 added pagination 2024-08-11 21:13:22 -04:00
john-okeefe 15d61290be renamed watchlist heading 2024-08-11 20:44:19 -04:00
john-okeefe d573b871ae moved login data to header 2024-08-11 20:42:57 -04:00
john-okeefe 8daf3af5f9 made a bunch of frontend variables global 2024-08-11 20:27:58 -04:00
john-okeefe aaf0f421f2 fixed app to work with global variables 2024-08-09 15:14:39 -04:00
john-okeefe eeb4a62f26 cleaned up grid links and text 2024-07-31 19:33:04 -04:00
john-okeefe 7af14ad7f3 made it so we login and grab user watchlist on startup 2024-07-30 20:37:44 -04:00
john-okeefe c6972ad765 added login to simkl button on frontend 2024-07-30 12:57:30 -04:00
john-okeefe 784e6c0b7d playing with datepicker options 2024-07-29 16:54:05 -04:00
john-okeefe ada4832904 added rating to watchlist queue 2024-07-27 21:17:30 -04:00
john-okeefe 9e0b05fb60 cleaned up search javascript 2024-07-26 17:01:55 -04:00
john-okeefe e3cde57f62 made modal usable from header and body 2024-07-26 16:50:42 -04:00
john-okeefe d89121a4de got search dropdown mostly finished
From here I just want to polish up the looks and make it cleaner and
bigger
2024-07-25 21:11:18 -04:00
john-okeefe 69ce979367 allow two children to get single anime and launch modal 2024-07-25 20:02:15 -04:00
john-okeefe 93f54d8425 going to try to call this function from Search 2024-07-25 16:29:28 -04:00
john-okeefe 286ecbfddd created modal to show single anime status 2024-07-25 09:18:08 -04:00
john-okeefe 59fe3d32ff added tailwind and cleaned up page
Cleaned up page to allow Tailwind to start handling the look and feel of
everything
2024-07-24 09:17:39 -04:00
john-okeefe cbef98f293 added ability to get Anilist Item, Search and JWT token 2024-07-21 10:25:21 -04:00
john-okeefe 49e399d50c added wails Svelte Template 2024-07-09 10:16:53 -04:00