Commit Graph

33 Commits

Author SHA1 Message Date
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
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
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
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
b2250b2b95 feat: add fontFamilies array 2025-07-06 11:23:15 +02:00
Julien Calixte
84789393ad fix: distinct multiple layer of cache 2024-10-27 12:33:26 +01:00
Julien Calixte
df25634b98 add a method to cache all files when necessary 2024-09-01 00:36:13 +02:00
Julien Calixte
2cab8c8e3f autoimport with eslint now 2023-08-14 18:04:27 +02:00
Julien Calixte
133a998ef8 rename previous hook 2023-08-13 21:10:21 +02:00
Julien Calixte
1b7f7539a8 note more hook involved 2023-08-13 21:09:52 +02:00
Julien Calixte
d4f9b7bcb1 Merge branch 'main' of github.com:jcalixte/lite-note 2023-08-13 21:07:24 +02:00
Julien Calixte
656e4b14a9 store has a first copy of readme from cache is no waiting 2023-08-13 21:07:17 +02:00
Julien Calixte
32a76ca3b7 integrate need review cards 2023-08-06 21:27:01 +02:00
Julien Calixte
ef84711e1c 🐛 (repo) one readme per repo 2023-07-16 15:33:02 +02:00
Julien Calixte
203db4c00a (backlinks) init backlinks 2021-06-05 16:39:26 +02:00
Julien Calixte
9ff73f09ac 🐛 (authentication) simplify refres… 2021-05-27 13:33:31 +02:00
84ba5fcd46 🐛 (login) refresh token 15 minutes before expiration 2021-05-13 16:34:30 +02:00
Julien Calixte
9afe9ef289 🔧 (eslint) 2021-05-09 00:52:09 +02:00
Julien Calixte
d33fa18b9c 🐛 (refresh) refresh correct token 2021-05-02 18:33:46 +02:00
Julien Calixte
7a5275dd2e (refresh) refresh when requesti… 2021-05-02 17:21:24 +02:00
Julien Calixte
e88584e24d ♻️ (sign in) 2021-05-02 16:47:48 +02:00
Julien Calixte
b246872f23 🐛 (github) remove refetch not working 2021-05-02 00:01:41 +02:00
Julien Calixte
0e52b16b1b Feat/GitHub auth (#6)
*  (sign in) create sign in to github button

*  (github login) login via github button

* 💄 (homepage)

*  (date fns)

*  (github login) refresh token when token expired
2021-05-01 23:35:38 +02:00
556ddb7f1e (user settings) init user settings with .litenote.json 2021-03-24 22:35:41 +01:00
e199c68d68 ♻️ (store) use a store to store readme and files 2021-03-24 21:23:23 +01:00
3749588b0b (path) create a resolve path service to manage …
resolve path like ../..
2021-03-21 15:27:02 +01:00