Commit Graph

94 Commits

Author SHA1 Message Date
tdurieux f91db91cee wip 2026-05-04 11:30:42 +02:00
tdurieux 03826fe58b fix: don't break folder lazy-load and file navigation
Two regressions stacked from the recent tree work:

1. expandAllFolders (#496) was marking every folder open, including
   folders whose children weren't fetched yet. The directive then
   rendered an empty <ul> after each <a>, and the openFolder handler's
   "no sibling means we need to load" check silently treated the empty
   <ul> as already-loaded — so clicking the folder toggled the class
   but the children never appeared.

   Skip folders with empty children when pre-expanding, and harden the
   click handler so an empty <ul> still triggers a fetch.

2. The $routeUpdate handler (#510 follow-up) became async and called
   $scope.$apply(updateContent) at the end. Inside an already-running
   digest cycle this no-ops or throws, leaving file navigation stuck.

   Run updateContent() synchronously like before, and kick off any
   missing parent-directory fetches in the background — getContent()
   already falls back to sha "0" when the metadata isn't loaded yet.
2026-05-04 11:25:32 +02:00
tdurieux 5c7eb23336 fix: don't crash and stay stuck on a subdir markdown link
Clicking a markdown link into a subdirectory's README threw
"Cannot read properties of undefined (reading 'sha')" and left the
viewer on Loading…. The route handler called updateContent() without
loading the new directory's file listing, so getSelectedFile() returned
undefined and getContent() then dereferenced fileInfo.sha.

Two fixes:
- getContent() falls back to sha "0" when fileInfo is undefined.
- The $routeUpdate handler walks the new path and loads any directory
  listings that aren't yet in $scope.files before rendering, so the
  selected file actually has its sha by the time we fetch.

Fixes #510.
2026-05-04 11:10:12 +02:00
tdurieux 117406f2ce refactor: route anonymize preview through the backend
The form's live README/PR preview was running its own copy of
ContentAnonimizer in the browser. The two implementations had been
drifting — recent fixes for word boundaries (#175/#249), accent
matching (#280), custom replacements (#285), and the diacritic-stripped
variants only landed on the server. Reviewers saw one anonymization;
authors composing the form saw another.

Add POST /api/anonymize-preview that takes a snippet (or a batch) plus
the user's options and runs them through the same ContentAnonimizer
the file route uses. Replace the client-side anonymizeReadme() body
with a debounced call to that endpoint. The PR view's
anonymizePrContent() runs as a synchronous template expression, so it
now reads from a {original -> anonymized} cache that's refreshed in
the background whenever the PR details, terms, or options change.

Single-flight + debounce keep the form responsive; an in-flight
request is dropped on the next change.
2026-05-04 11:05:50 +02:00
tdurieux c8fc561dac fix: regex characters in terms shouldn't block submission
Entering an IP address (e.g. 192.168.1.1) or any term with regex
metacharacters made the form invalid because the "regex characters
detected" hint was wired up via $setValidity('terms', 'regex', false).
The text in the UI labels it as a warning, but the form treated it as
an error and refused to save.

Track the warning as a plain $scope flag and show it via ng-show on
that flag, so the form stays valid (#430).
2026-05-04 10:58:17 +02:00
tdurieux 59d9805276 update titles 2026-05-04 09:33:44 +02:00
tdurieux db2ac5307d fix admin 2026-05-03 22:29:01 +02:00
tdurieux 6096cb0744 fix: expand every folder by default in the explorer tree
The file tree opened collapsed, requiring the reviewer to click each
folder before they could see what was inside. Walk the tree on first
render and mark every folder open in $scope.opens. Folders the user
has explicitly toggled (a previous entry already exists in
$scope.opens) are left as-is, so collapsing still works.

Fixes #496.
2026-05-03 22:28:27 +02:00
tdurieux b316d18bd8 fix: clicking a gutter line updates the URL to #L<n>
The viewer already supported jumping to a line via #L42 in the URL but
never produced one — users had to type it manually. Wire guttermousedown
on the ACE editor to replaceState a #L<n> hash, with shift-click for a
range. Also reapply the highlight on hashchange so pasting a URL into
the address bar works without reload.

Fixes #392.
2026-05-03 20:25:41 +02:00
tdurieux 9f1ae1924b fix: auto-dismiss toast notifications after 8s
Toasts used class="toast show" with ng-repeat but never initialized
Bootstrap's toast plugin, so they stayed pinned until manually closed.
Each navigation re-fired toasts (e.g. "README not found in github
pages"), stacking duplicates.

Add an $scope.addToast helper that schedules removal via $timeout, and
route all push sites through it.

Fixes #246.
2026-05-03 19:35:42 +02:00
tdurieux a5f66d6844 multiple fixes 2026-05-03 15:30:54 +02:00
tdurieux 88f826aab4 update design 2026-04-24 14:55:18 +02:00
Thomas Durieux 261eaa8d79 Polish website UX: unify dashboards, clean up layout, modernize styling (#668) 2026-04-15 09:30:19 +02:00
tdurieux d8dd408a65 fix: avoid cache of list of files 2024-07-22 16:20:18 +02:00
Sebastian Ramacher 9271332d5b chore: Fix typos (#292) 2024-05-28 19:11:19 +02:00
tdurieux e9e881fdc3 fix(#290): fix tree rendering of files inside a single folder 2024-05-15 11:18:16 +02:00
tdurieux a30d5b31a6 fix(#286): fix open and closing folder 2024-05-13 18:45:11 +02:00
tdurieux 93606a5c39 fix: catch error when requesting a folder 2024-05-03 10:49:25 +02:00
tdurieux 3a00a27153 feat: improve support for binary & audio files 2024-04-28 10:01:40 +01:00
tdurieux a86e050f8b fix: handle empty repository 2024-04-26 13:48:32 +01:00
tdurieux a0dff4389d fix: fix ui folder tree 2024-04-26 12:50:24 +01:00
tdurieux b0fa5e6689 fix: hot fix, replace repoID by repoId 2024-04-26 12:40:56 +01:00
tdurieux 710f7328e7 feat: flatten file tree for better performance 2024-04-26 10:32:09 +01:00
tdurieux 6b9574add3 fix: improve repository rename 2024-04-11 17:13:01 +01:00
tdurieux cb3d999ed3 fix: add missing KaTeX fonts 2024-04-05 12:02:50 +01:00
tdurieux f30110c567 fix: improve link rendering 2024-04-05 11:04:29 +01:00
tdurieux c3a890dac7 fix: fix minimization of the client js 2024-04-05 10:34:24 +01:00
tdurieux 22a28a913d perf: improve page loading time 2024-04-05 01:02:41 +01:00
tdurieux 8fdd6228e4 fix(#251): fix notebook and code dark mode 2024-04-04 18:35:01 +01:00
tdurieux f5d45394bf feat: add sha to file path to avoid caching 2024-04-04 15:56:38 +01:00
tdurieux 795a67cdb2 fix: fix anonymization client script 2024-04-03 18:41:00 +01:00
tdurieux e24d1b4630 update dependencies & remove google analytics 2023-06-20 09:58:25 +02:00
tdurieux 2f916c6968 fix: auto select file when a folder is selected 2023-05-08 15:39:17 +02:00
tdurieux 3bf6864472 feat: improve error management in front end 2023-04-26 00:27:52 +02:00
tdurieux c9acb7b899 feat: improve response content type header 2023-04-25 17:42:50 +02:00
tdurieux 3627096e63 feat(#148): add support for Math expression 2023-04-21 12:29:19 +02:00
tdurieux 4293fa01b2 feat: add media player in content view 2023-04-20 23:30:26 +02:00
tdurieux e94a5f164a disable download mode for the moment 2023-04-05 12:12:57 +02:00
tdurieux 74aacd223d fix(#186): use a different name for the hostname configuration 2023-03-02 16:39:01 +01:00
tdurieux 8221b2ee7f feat: dont download notebook if not necessary 2023-02-23 16:21:08 +01:00
tdurieux 5c72f54db5 perf: improve the perf of Anonymous GitHub 2023-02-08 15:34:50 +01:00
tdurieux 6debb6aa0f fix: do not change repoID 2023-02-07 09:10:15 +01:00
tdurieux 6d4067bf6d feat: improve error message during anonimization 2023-02-07 09:03:04 +01:00
tdurieux d01c839616 fix: fix regex detection 2023-02-06 13:04:35 +01:00
tdurieux f897b5ba5b feat: improve dashboard search layout 2023-02-06 12:55:32 +01:00
tdurieux 8ec1fd4090 fix: escape regex characters when invalid 2023-02-04 09:31:58 +01:00
tdurieux 692ea33b5d feat(#162): add warning message when regex charater is detected inside terms 2023-02-03 16:22:19 +01:00
tdurieux 5cf914bbc5 fix: fix diff with html tag 2023-01-22 12:59:48 +01:00
Thomas Durieux 73e46f926f feat: add support for pull requests (#156) 2023-01-22 12:54:14 +01:00
tdurieux 231b2fe0c8 feat(#137): adds support for md rendering in webview 2022-10-24 08:34:53 +02:00