Commit Graph

82 Commits

Author SHA1 Message Date
Julien Calixte
84a252e926 feat(notes): swap heading and paragraph fonts with a button
All checks were successful
CI / verify (push) Successful in 1m7s
Replace the heading/paragraph toggle with the intended UX: keep both font
dropdowns visible and add a button that exchanges the two fonts via a new
swapFonts store action.
2026-06-30 00:47:10 +02:00
Julien Calixte
4104e138c1 refactor(notes): rename title font to heading font
These fonts apply to markdown headings (h1-h6), so "heading" is more
accurate than "title". Renames the chosen*Font field, store action, and
the --heading-font-family CSS variable.

Keeps backward compatibility: .remanso.json still honors the legacy `t`
key (alongside the new `h`), and a saved `chosenTitleFont` in
localStorage is migrated on load so existing preferences survive.
2026-06-30 00:41:54 +02:00
Julien Calixte
1b47101340 fix(notes): persist new SHA and dedup files by path on edit
All checks were successful
CI / verify (push) Successful in 2m2s
Editing a note in a stacked note saved cache without the path, so
store.files never received the new SHA and lookups went stale. Pass the
path through, and make addFile dedup by path as well as SHA so an edit
(same path, new SHA) replaces the old entry instead of duplicating it.
2026-06-28 23:52:37 +02:00
Julien Calixte
9f21cb7882 chore: merge origin/main with local test additions
All checks were successful
CI / verify (push) Successful in 10m1s
Resolves conflict in repo.spec.ts by combining getRepoPermission
tests from main with the getFiles and queryFileContent tests from
the local test pass. Adds getRepoPermission to the userRepo.store
spec mocks so the new permission probe added upstream doesn't break
the store tests.
2026-06-06 22:17:10 +02:00
Julien Calixte
1a2d8f4ebf chore: add tests 2026-06-06 22:13:14 +02:00
Julien Calixte
a09e541fa8 feat(repo): hide write UI for users without push access
Fetch the viewer's push permission via GET /repos/{owner}/{repo} when
entering a repo and gate every write affordance behind it: edit and
image-upload buttons in StackedNote, new-fleeting-note and YouTube
buttons in FleetingNotes, and interactive checkboxes in TodoNotes
(rendered disabled when read-only). Anonymous viewers get the same
treatment because the permissions field is absent without auth, which
collapses to canPush = false.

Previously every write button was visible regardless of role, so
read-role collaborators and anonymous viewers could enter edit mode and
type before the save failed with 401/403.
2026-05-29 15:24:12 +02:00
Julien Calixte
b87836782b fix(notes): persist uploaded image to cache so it survives reload 2026-05-25 21:29:51 +02:00
Julien Calixte
151a4d9137 fix(github): auto-retry GitHub calls on 401 and expose unauthorized state
fetchLatestSha and queryFileContent were silently catching every error
(including expired-token 401s) and returning null, so the freshness
badge could stay on "offline" with no UI hint that re-auth was needed.
Wrap both calls in runWithAuthRetry to recover from refreshable tokens
transparently, and switch fetchLatestSha to a tagged result so the
freshness hook can distinguish auth failure from network failure.
2026-05-17 21:10:20 +02:00
Julien Calixte
c412c75cfd feat(auth): add force option and runWithAuthRetry helper
GitHub refresh tokens are single-use, so concurrent refreshes race and
the loser ends up with a revoked token — dedupe in-flight calls.
2026-05-17 21:10:13 +02:00
Julien Calixte
e11609990d fix(repo): derive starred list from saved favorites
Starred section used to intersect favorites with the paginated GitHub
repo list, so favorites past the first page only appeared after the user
scrolled. Derive RepoBase directly from PouchDB favorites and exclude
them from "all repos" by both id and name.
2026-05-17 00:24:47 +02:00
Julien Calixte
e121cc2d05 fix(repo): dedupe favorite repos by name
Stale FavoriteRepo docs with old GitHub IDs (e.g. from deleted or
recreated repos) surfaced as duplicates once the prefix scan started
returning every doc.
2026-05-17 00:24:43 +02:00
Julien Calixte
f9e1495fc3 fix(repo): load all favorites without filtering by loaded repos
Previously favorites were only fetched for repos already loaded via
useRepos, hiding favorites whose repo metadata hadn't been resolved
yet.
2026-05-17 00:17:34 +02:00
Julien Calixte
fc4ed188d7 feat(repo): add Octokit request timeouts and retry UI
Before, every GitHub call awaited indefinitely with no AbortSignal,
so a "lie-fi" connection (technically online, effectively dead) left
FluxNote stuck on the skeleton loader and the freshness badge spinning
forever. Inject an 8s AbortSignal.timeout via octokit.hook.before
(20s override on the recursive tree fetch), classify failures in the
userRepo store as auth vs network, and surface a "Couldn't reach
GitHub" retry button when no cached content is available.
2026-05-16 23:28:11 +02:00
Julien Calixte
aad07184fd fix(freshness): surface silent failures when pulling latest
queryFileContent threw on octokit errors (stale SHA 404, expired token,
network blip) and the rejection bubbled up unhandled through pullLatest
and onBadgeClick, leaving the badge stuck on "Outdated" with no log or
toast. Wrap the octokit call, log on failure, clear the cached SHA so
the next click re-resolves it, and show an error toast.

Also fix a dead `if (!user || !repo) { null }` that did nothing.
2026-05-06 22:02:50 +02:00
Julien Calixte
30f200df30 fix(flux-note): stop showing sign-in prompt while readme is loading
Cache miss wrote null into store.readme before getMainReadme finished,
collapsing isLoading and surfacing the not-accessible UI mid-fetch.
Also branch that UI on auth state so signed-in users aren't told to
sign in when access fails.
2026-05-06 09:54:25 +02:00
Julien Calixte
5a9c0a3704 lint 2026-05-04 23:54:26 +02:00
Julien Calixte
adb1bd5945 fix: fix height on mobile 2026-04-29 10:34:46 +02:00
Julien Calixte
df3e217d01 fix(userRepo): unwrap reactive proxies before postMessage to worker
Vue reactive Proxies cannot be serialized by the Structured Clone
Algorithm used by postMessage/Comlink. Use toRaw() on this.files and
this.userSettings before passing them to data.update() to avoid the
DataCloneError.
2026-04-27 10:22:20 +02:00
Julien Calixte
9f75e7971d fix(layout): cache pageWidth in localStorage to avoid render glitch
The page width from .remanso.json was only applied after an async
PouchDB + network fetch, so notes briefly rendered at the default
500px before snapping to the configured value. Persist pageWidth
alongside the existing font cache (key renamed to remanso:layout:*),
so it is read synchronously during setUserRepo and applied before
the first render. Also always reset --note-width with a default
fallback to prevent stale values leaking across repo navigation.
2026-04-26 13:44:10 +02:00
Julien Calixte
e03ff49764 fix(mobile): restore overflow-y and unstick readme on vertical scroll
- Restore explicit overflow-y:auto on #main-app for mobile (removed in
  63f5d64) — implicit coercion from overflow-x:auto is not reliable in
  all Safari/WebKit versions.
- Override position:sticky on .readme to position:relative on mobile.
  The desktop sticky (left:0) is correct for horizontal scroll, but on
  mobile vertical scroll it pinned the 100dvh-tall readme across the
  entire viewport, hiding all stacked notes behind it.
2026-04-24 23:42:22 +02:00
Julien Calixte
ee8bbd4a37 feat(config): add pageWidth setting to .remanso.json
Allows repo owners to configure note column width via `"pageWidth": "700px"` in .remanso.json. Applies the value to the --note-width CSS variable and invalidates the cached width so resize/overlay hooks pick it up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:34:26 +02:00
Julien Calixte
e369541dc0 refactor: scope PouchDB writes to repo config, not user font prefs
chosen* fields are per-browser preferences — localStorage is the correct
and sufficient store for them. Removing data.update from font setters and
stripping chosen* from the GitHub fetch PouchDB write prevents stale PouchDB
data from conflicting with localStorage on reload.
2026-04-06 23:26:50 +02:00
Julien Calixte
73a6014750 fix: persist font selections across navigation and page reloads
- Use v-model with writable computeds instead of :value+@change so selects
  re-sync when the options list changes asynchronously
- Always include currently chosen fonts in sortedFontFamilies so a selected
  font not present in .remanso.json fontFamilies still shows in the select
- Initialize userSettings instead of returning early in font setters so
  changes made before async GitHub fetch completes are not silently dropped
- Back font choices with localStorage so they survive hard reloads even when
  PouchDB/IndexedDB fails silently in the web worker
2026-04-06 18:51:27 +02:00
Julien Calixte
006cd63388 feat: paginate repo list with infinite scroll
Load 30 repos at a time instead of 100 at once, showing data sooner.
Adds v-infinite-scroll to RepoList.vue to fetch subsequent pages on scroll.
2026-04-05 11:56:36 +02:00
Julien Calixte
99c349f6df fix: preserve font settings when repo has no .remanso.json
When no config file exists, userSettings was set to null which destroyed
cached user preferences and silently blocked all setFont* actions.
2026-04-04 14:39:34 +02:00
Julien Calixte
b003a3e008 perf: move PouchDB/IndexedDB operations to a Web Worker
All database reads and writes now run off the main thread via a
dedicated worker, eliminating IndexedDB overhead from the frame budget.

- Create data.worker.ts exposing the Data class via Comlink
- Refactor data.ts to export a Comlink-wrapped proxy and a standalone
  generateId() pure function (workers can't expose sync methods cleanly)
- Update all 10 call sites to import generateId directly instead of
  calling data.generateId()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 11:27:45 +02:00
Julien Calixte
1b5e23e3d4 fix: keep font settings visible during repo navigation
- resetFiles() no longer clears userSettings so FontChange stays visible
  while navigating between repos (old fonts show until new ones load)
- Add _requestId counter to setUserRepo() to discard stale async callbacks
  from previous navigations, preventing state corruption on quick nav
- Load savedRepo and userSettings caches in parallel with Promise.all,
  reducing yield points so cache hits apply before first render

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 11:21:56 +02:00
Julien Calixte
20e9538983 feat: mv profile to footer 2026-03-28 20:24:08 +01:00
Julien Calixte
5f48aa5690 chore: lint and fmt 2026-03-28 09:38:55 +01:00
Julien Calixte
8b921f1adb refacto: look after remanso now 2026-02-14 14:40:11 +01:00
Julien Calixte
683187b4d1 feat: render some real content 2026-02-11 03:12:52 +01:00
Julien Calixte
b93dfbd824 perf: run on nextTick only if necessary 2025-07-12 17:39:00 +02:00
Julien Calixte
df250750e5 feat: add chosen font size 2025-07-06 15:49:58 +02:00
Julien Calixte
b2250b2b95 feat: add fontFamilies array 2025-07-06 11:23:15 +02:00
Julien Calixte
0f119d1f6a prune: remove theme in litenote config 2025-02-11 22:21:32 +01:00
Julien Calixte
e2285f8128 feat: take into account font size (#11) 2025-02-11 21:56:07 +01:00
Julien Calixte
0fe71068e7 upgrade typescript 2024-11-26 22:00:56 +01:00
Julien Calixte
84789393ad fix: distinct multiple layer of cache 2024-10-27 12:33:26 +01:00
Julien Calixte
ffa7c42021 fix: more resilient saved to avoid conflict. (no need to add the README main file when saveCacheNote) 2024-10-27 12:07:32 +01:00
Julien Calixte
941f867031 cache all notes 2024-09-01 22:27:51 +02:00
Julien Calixte
df25634b98 add a method to cache all files when necessary 2024-09-01 00:36:13 +02:00
Julien Calixte
b4a7571b8a Sep 1, 2024, 12:02 AM 2024-08-31 22:02:18 +00:00
Julien Calixte
b9a14e205f refacto: more consistent code 2024-07-19 20:11:41 +02:00
Julien Calixte
15296b8832 Now files from repo are cached to be quickly retrieved even offline 2024-07-19 20:05:42 +02:00
Julien Calixte
8090f838be download font integration 2024-04-06 14:50:10 +02:00
Julien Calixte
c7ea52c7f8 add path to new inbox file in pinia store
Not ideal to have data in multiple store (pinia and PouchDB) but it work this way. May need a refactoring.
2023-11-26 10:35:38 +01:00
Julien Calixte
1d21ac50b2 ️ (user settings) cache user settings 2023-09-11 23:02:52 +02:00
Julien Calixte
4adaad8683 lower timeout time 2023-09-09 20:45:43 +02:00
Julien Calixte
c249fb886a ️ (user settings) eager api call 2023-08-28 23:55:41 +02:00
Julien Calixte
bd9d97b0af trying to be as little blocking as possible 2023-08-17 20:06:32 +02:00