Commit Graph

1608 Commits

Author SHA1 Message Date
Erik Michelson c2ccf48c39 feat(media): permission checks for accessing media uploads
Previously, media uploads were associated with one note upload but
served regardless of the requesting user's permission. As we have
a fine-grade permission system in place, we can use this as well
for enforcing permission checks on media uploads. In order to make
an upload reusable across multiple notes, this adds the capability
to link one media upload to multiple notes and unlink that accordingly
again.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-24 22:17:00 +02:00
Erik Michelson 16e769bd60 feat(renderer): add sync-view of slides in the editor
The slide where the user currently has their cursor in the editor,
will automatically be viewed in the renderer side.
This behaviour is toggable using the existing sync-scroll setting.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-22 22:42:23 +02:00
Erik Michelson a27607b28b test: update snapshots and splitter tests
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-22 22:25:35 +02:00
Erik Michelson 1dc4fea414 refactor(splitter): make splitter thinner and totally draggable
It was mentioned that the splitter was too thick and therefore
taking up too much screen-space. This commit changes it to be thinner.
While the visual representation is just a thin line, the actual trigger
zone is wider to make it not a perfect-pixel-matching game.
Furthermore, you can now drag the splitter on every point of it, not
just on the button.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-22 22:25:35 +02:00
Erik Michelson da9f1d9b8e feat(renderer): hide reveal.js controls in editor renderer
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-19 14:23:43 +02:00
Erik Michelson 58593cc4c6 fix(editor): adjust TOC colors for accessability
Previously the hardcoded colors only made a contrast of 3.39 to the
background. Furthermore changing the overall theme variables wouldn't
change the colors for the table-of-contents as well. This commit
changes that to use the theme variables, therefore ensuring better
maintainability and contrast (now 7.29)

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-19 13:36:14 +02:00
Erik Michelson 77a59c3a26 fix(renderer): allow opening browser popups from sandbox for pdfs
Apparently, opening a link from a sandboxed iframe enabled the
sandbox mode for the opened new tab as well. For most pages,
this is not a problem since these pages don't depend on anything
special. However when clicking a link to a PDF file, Chromium-
based browsers don't open the tab, since the built-in PDF viewer
is not compatible with the sandboxing.
The attribute `allow-popups-to-escape-sandbox` allows pages opened
from the sandbox into a new tab to be not sandboxed. Since we don't
have opener access there, this is no risk to HedgeDoc and can safely
be enabled and therefore fix PDF links.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-19 13:31:28 +02:00
Erik Michelson be67b09a9e fix(renderer): apply dark mode properly to mermaid diagrams
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-07-15 10:19:41 +02:00
Philip Molares 2f34e0d778 refactor(frontend): remove revision revert button
We did not implement this functionality yet and won't for some time so in order for HedgeDoc 2 to become release ready, this button will be removed.

Fixes #6478

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-14 01:10:56 +02:00
Philip Molares e852bef113 fix(frontend): wrong notification key
The notification key 'editor.modal.permissions.error' was meant to be used with the ErrorToI18nKeyMapper as a base
which gets different suffixes added depending on the error code and not as a normal error code by itself.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-13 23:59:37 +02:00
Erik Michelson 82467ed76a feat(frontend-api): show error message to user on rate-limit exceeded
Fixes #6472

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-13 23:06:02 +02:00
Erik Michelson 2d10b7cfff feat(editor): show notification on permission revoke + redirect
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-13 22:09:10 +02:00
Philip Molares fb87cee9c2 fix(frontend): redirect user to DEFAULT_FALLBACK_URL when permissions update fails after PERMISSIONS_UPDATED message
Fixes #6475

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-13 22:09:10 +02:00
Philip Molares f9077d7ff5 refactor(frontend): export DEFAULT_FALLBACK_URL
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-13 22:09:10 +02:00
Erik Michelson 89e441597d refactor(commons): frontmatter validator uses zod and allows custom options
The frontmatter validator was still the one left place that used Joi instead
of the now widely used zod in HedgeDoc. Since zod can do validation, coercion
and providing types based on the schema, the code could be drastically reduced
compared to the old frontmatter validator.

At the same time, the validator is now less strict. Custom fields are still
allowed for people that want to add their own frontmatter tags which are
unrelated to HedgeDoc. Furthermore, we now allow the complete set of
RevealOptions for the slideOptions key instead of only a few handpicked
ones.

Fixes #5946

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-13 21:05:08 +02:00
Philip Molares 016ec6fd90 fix(frontend): only show register infos when links are configured
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
Fixes #6469

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-09 13:36:09 +02:00
Erik Michelson 033e627bab fix(frontend): updates to test files after linting changes
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-09 13:05:59 +02:00
Erik Michelson 8988e3868f fix(frontend): accessibility issues and other linting problems
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-09 13:05:59 +02:00
Erik Michelson 50d0585ccb fix(frontend): buggy imports and type definitions due to TS-linting
These problems were detected by type-aware linting

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-09 13:05:59 +02:00
Erik Michelson faaea84a73 chore(lint): enable TypeScript linting in frontend
oxlint now includes support for TypeScript-aware linting by using
the oxlint-tsgolint package. While this increases the chance of
finding bugs early, it requires a few changes to the TypeScript
configuration, especially the explicit declaration of CSS imports
and changing the moduleResolution to bundler mode.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-05-09 13:05:59 +02:00
Philip Molares 45f526bf8b fix(editor): don't show error if alias is empty
Fixes #6480

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-03 20:24:04 +02:00
Philip Molares 1d3cac4d84 fix(editor): add explanation to publicly visible switch
Fixes #6479

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-05-03 20:17:16 +02:00
Philip Molares 1eb9ee2385 fix(readOnly): untangle edit button from toc button
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
Fixes #6485

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-30 01:19:37 +02:00
Philip Molares 473fac6885 fix(readOnly): make image lightbox usable
Fixes #6486

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-30 01:00:12 +02:00
Philip Molares 1d00334019 fix(translation): change noteDeleted error message
Mention the explore page instead of the history page

Fixes #6483

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-30 00:11:14 +02:00
Philip Molares 22288891f7 chore: change history to explore page
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-30 00:11:14 +02:00
Philip Molares 4db2f354de fix(editor): remove changing color from pin sidebar entry
Instead of a changing color, we now use a chaning icon.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:50:11 +02:00
Philip Molares 1a56e3ad15 fix(editor): use setNotePinStatus instead of setPinnedState
This method updates the backend and changes the redux state in one call, instead of just calling the backend.
With this the state get's updated, and the user see that they pinned a note immediately.

Fixes #6484

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:50:11 +02:00
Philip Molares 6b226a0f7a fix(explore): make navigation and search sticky
The navigation and the search box will now always be at the top of the page when scrolling

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:21:00 +02:00
Philip Molares 98db62f196 fix(explore): rework metadata box allignment
The box with username, and last edit is now always 12 rem wide and looks more even that way

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:21:00 +02:00
Philip Molares 8729fb207b fix(explore): add extra margin to endMessage of infinity scroll
This way the message doesn't seem so squeezed in

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:21:00 +02:00
Philip Molares d60a67ee33 fix(explore): always keep the notes list as high as two entries
This prevents problems with the dropdown menu creating a scroll bar

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-29 22:21:00 +02:00
Philip Molares c81dd893e7 fix(login): redirect correctly after login / registration
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
We had two different approcaches to the redirect after the login / registration.
Because of this there were race conditions, and we sometimes got stuck on the redirect page.

Fixes #6467

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-04-23 23:54:56 +02:00
Erik Michelson 5b026c052a fix(csrf): refresh token after user has deleted their account
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-04-09 21:47:30 +02:00
Nicolai Søborg 3c18898e47 Image: use relative url
Embedding the full URL into the notes is a bit anoying if you want to
change hostname (or e.g. hosting from a local IP). Using the relative
URL should work in all(?) cases afaik.

I would also like to remove that `additionalUrlText` argument, which is
a bit confusing (not sure it works as intended?). It is only used in
file `use-on-image-upload-from-renderer.ts` - and not sure it even is
set to anything

Signed-off-by: Nicolai Søborg <git@xn--sb-lka.org>
2026-04-09 21:29:57 +02:00
Erik Michelson 84852c22be feat(editor): add button to open current note in read-only/slides mode
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-03-25 22:47:22 +01:00
Erik Michelson 0720534d7e fix(logout): refresh CSRF token after logout
Since the CSRF token is stored in the session, which is invalidated
on logout, we need to fetch a new token after logout.
Otherwise the client would require a full page reload to obtain a
new token.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-03-25 21:56:55 +01:00
Philip Molares e16d5d5349 fix(frontend): remove lowercaseUsername from UsernamePasswordLogin component
We don't use this functionality anymore

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-03-25 20:15:11 +01:00
renovate[bot] c52b83ae58 fix(deps): update dependency dompurify to v3.3.2 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-24 12:55:24 +01:00
renovate[bot] 8d606b3b4b fix(deps): update dependency @dicebear/core to v9.4.1 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-24 12:54:04 +01:00
Erik Michelson 29f60f1d9b fix(aliases): verify alias regex in frontend and backend
Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-03-24 12:49:12 +01:00
Philip Molares 2a2bd92265 feat(alias): allow mixed case aliases
Aliases should be saved as is, but in the search we should use like

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-03-24 12:49:12 +01:00
renovate[bot] d99c311f3b fix(deps): update dependency yjs to v13.6.29
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
Deploy HD2 docs to Netlify / Deploys to netlify (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 12:36:14 +01:00
renovate[bot] a1ced25475 fix(deps): update dependency mermaid to v11.12.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 12:35:15 +01:00
renovate[bot] 85498bacf8 chore(deps): update testing-library
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 12:33:02 +01:00
renovate[bot] b9498adca1 fix(deps): update dependency react-infinite-scroll-component to v6.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 12:20:19 +01:00
renovate[bot] 1f6eeecaaa fix(deps): update dependency @dicebear/identicon to v9.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 01:33:51 +01:00
renovate[bot] 536d782ff2 fix(deps): update dependency i18next-browser-languagedetector to v8.2.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 01:33:38 +01:00
renovate[bot] 687d3b9bf4 fix(deps): update dependency @dicebear/core to v9.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 01:27:22 +01:00
renovate[bot] e5833cf04b fix(deps): update dependency ws to v8.19.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 00:43:22 +01:00