Commit Graph

4906 Commits

Author SHA1 Message Date
Su bb09eb4f28 fix(server): keep well-known 404s out of the frontend cache policy (#6497)
Co-authored-by: suzhiguo7 <suzhiguo7@users.noreply.github.com>
2026-10-26 21:05:32 +08:00
boojack c2bab22460 chore(editor): add a Markdown mode corner label 2026-10-26 20:55:48 +08:00
johnnyjoygh 6387991fdd chore(web): update focus mode
- Bump @usememos/editor to 26.10.27: Markdown mode now highlights syntax
  inside table cells, so a URL anchor in a table-cell link, such as
  [Kappa](/memos/abc#ikebukuro), reads as part of the URL instead of a
  tag.
  Refs usememos/memos#6480 (item 13).
- Focus mode: a narrower sheet (max-w-3xl) with larger text through
  MEMO_FOCUS_EDITOR_THEME; its header shows only the memo's time ("Now"
  before it has one) and the exit button; toggling it runs a view
  transition that grows the frame out of its place on the page and back,
  instant under reduced motion or without view transitions.
- Markdown mode's + menu item uses Lucide's CodeXml instead of the
  pilcrow.
2026-10-26 08:40:24 +08:00
Johnny 0bfa31e89e feat(web): editor 26.10.26 with Markdown mode, checklist chip and plain tags in source mode (#6498) 2026-10-24 19:48:46 +08:00
johnnyjoygh 3eeac84ea2 fix(server): keep hidden paths out of the SPA fallback
The frontend handler served index.html for any extensionless path, so
OAuth Protected Resource Metadata probes under /.well-known/ received
HTML with status 200. MCP clients that run RFC 9728 discovery before
trusting the endpoint failed to parse it, while a 404 would have told
them the server does not advertise OAuth.

Paths with a hidden segment are never app routes: usernames, memo UIDs,
and fixed routes all begin with an alphanumeric character. Return 404
for them, following RFC 8615 for /.well-known/ and the dotfile
convention of common static servers for paths like /.git/.

Fixes #6495
2026-10-24 10:19:03 +08:00
Johnny 28719a925f fix(web): keep blurred memo content out of the detail sidebar (#6494) 2026-10-23 07:43:31 +08:00
tongjin 901bf9f4cc feat(markdown): allow Bilibili player iframes (#6490)
Co-authored-by: johnnyjoygh <johnnyjoygg@gmail.com>
2026-10-23 07:32:36 +08:00
Johnny 9576bd53ac feat: filter memos by attachments and images (#6492) 2026-10-22 18:58:45 +08:00
johnnyjoygh 008dded234 fix(filter): drop the bind arguments of folded operands
The renderer discarded the SQL of an operand that folded to a constant,
such as the left side of `x || true`, but kept the arguments it had already
added. Callers append their own predicates after the filter fragment and
bind positionally, so each leftover argument bound to a later placeholder.

Fold boolean constants out of the condition tree before rendering, so a
subtree either renders with its arguments or not at all, and reject any
rendered fragment whose placeholders and arguments disagree.
2026-10-22 09:17:23 +08:00
Johnny 5cdb9ee399 fix(api): hide the instance admin from anonymous profile requests (#6491) 2026-10-22 08:26:33 +08:00
johnnyjoygh 334925a5f1 chore(web): bump @usememos/editor to 26.10.25
Tables are styled like claude.ai's: the table fills the editor's width
with a round frame, a tinted header row, lines between rows and no
vertical lines, and cells wrap at words instead of mid-word. HTML tables
rendered through the html view look the same.

Footnote definitions render their text as Markdown. In read-only memos
the referenced definitions are collected in a section at the end of the
note, above the attachments, in order of first reference, each with a
backlink per reference; unreferenced definitions are left out and
labels show as written. While editing, definitions stay where they are
written.

Both fix items reported in #6480. Wire the editor's two new labels,
`footnotes` and `backToReference`, to new `editor` keys in every locale.
2026-10-21 23:30:18 +08:00
johnnyjoygh 24cce5ca27 perf(editor): replace highlight.js with Highlights tokens 2026-10-21 21:46:11 +08:00
johnnyjoygh c640884067 chore(ui): refine shared controls and floating surfaces
Use neutral, theme-aware surfaces and consistent density for hints,
menus, dialogs, and form controls. Restore visible field focus and use
Base UI tabs for keyboard navigation and RTL support.
2026-10-21 21:32:32 +08:00
johnnyjoygh ccc1f82393 refactor: keep link preview and double-click edit as device preferences
Link preview was a Timeline view option, so it reset to on everywhere else.
Double-click to edit was an instance setting an admin chose for everyone.
Both are presentation choices for one browser, so they now live in a single
localStorage-backed store shared by every memo view and are toggled from
Settings > Preferences under "This device".

MemoRelatedSetting.enable_double_click_edit is removed from the API and
storage protos and reactions becomes field 1; stored rows that still carry
the old key load unchanged. The admin Memo page keeps only reactions.
2026-10-21 07:34:33 +08:00
johnnyjoygh 59afd178ff chore(web): bump @usememos/editor to 26.10.24
Pass the editor palette once as `tokens.colors` instead of the same object
as `light` and `dark`. Drop the heading sizes, leading and weight from the
app's heading classes: the editor sets them in its own unlayered stylesheet,
scaled from its `fontSize` and `lineHeight` tokens, so the Tailwind sizes
never applied and would not follow a changed token. Only the muted h6 color
remains. No `highlight` token: memos' HTML sanitizer drops `<mark>`.

Correct the color guide's theme-switching section, which described a
`.dark` class memos does not use and which the editor would now follow.

Inline raw HTML inside a link, such as ruby annotations in a table cell,
now renders through the HTML view in both the composer and the memo view.
2026-10-20 23:21:42 +08:00
boojack 02e163f8d7 fix(web): render the Home composer with the page
The editing session became a lazy chunk in #6481, so a signed-in user's
Home showed a blank card until the chunk arrived, then the feed jumped up
18px when the real composer replaced it.

The Home and Explore routes of a signed-in user now load the session's
code together with the page, so the composer renders with the page as it
did before the split; visitors keep the lighter page. Where a draft can
still suspend, the fallback is a still of the empty composer with the
same frame, placeholder line and toolbar height, so nothing moves when
the session takes its place.
2026-10-20 21:57:16 +08:00
boojack 48259e6022 docs: sync README branding from .github 2026-10-20 21:15:48 +08:00
ici f0ee2fd448 fix(web): restore default focus behavior in dialogs (#6279) 2026-10-19 13:58:40 +08:00
johnnyjoygh bf67323d1d chore(web): draw Mermaid diagrams with Pele
Replace mermaid with pele for ```mermaid code blocks. Diagram types load
on first use through pele/lazy, the SVG takes its colors from --pele-*
variables mapped to the theme tokens in index.css, so a color scheme
change needs no redraw, and the layout shrinks to the memo's width while
keeping the author's direction.

Bump @usememos/editor to 26.10.22.
2026-10-19 00:35:57 +08:00
johnnyjoygh 0b53427b82 chore(web): bump @usememos/editor to 26.10.21
Brings the inline HTML pairing fix so ruby annotations render again.
2026-10-18 22:50:37 +08:00
boojack 07538326a9 chore: apply the brand copy and reshape the README
Take the tagline, one-liner, and short description from the rewritten
BRAND.md in usememos/.github and use the serif lockup and the light and
dark timeline previews published there. The README now leads with what a
visitor gets, keeps the quick start to one command plus the URL to open,
drops badges that repeat the sidebar, and carries the star-history
badges
instead of the chart. The local Georgia wordmark is removed.

In the app, the about page, manifest, and English locales carry the same
copy. The identity label uses the theme's serif stack at the wordmark's
weight and spacing rather than a vendored face. The about tagline sizes
to its column so neither sentence breaks mid-line, and the version chip
is the single place for build identity: a release links to its tag and a
development build links to its commit, so the Build commit row and its
locale label are gone.
2026-10-18 20:53:48 +08:00
boojack 3bea6df030 refactor(web): one memo component, MemoEditor, with view and edit modes (#6481) 2026-10-18 12:11:55 +08:00
johnnyjoygh 1a51572406 feat(web): add source mode to the memo composer
The composer can show the whole memo as Markdown text and edit it as
plain
text, using the editor's new source mode.

- Turn it on from the + menu ("Source Mode"); a small "Source" tag in
  the
  editor's corner names the mode and switches back to rich text. The
  first
  line leaves room for the tag.
- The choice is remembered per device and applies to every composer.
- Tags and tasks are read from the Markdown text in source mode, so tag
  suggestions still skip tags the memo already has; the checklist chip
  is
  hidden because it cannot apply.
- A saved caret remembers its mode and is not restored in the other one.
- DropdownMenuCheckboxItem gains `indicator="end"` for a trailing check,
  replacing a className override in the sidebar Tags menu.
2026-10-17 00:21:56 +08:00
johnnyjoygh b736c0202c chore(web): bump @usememos/editor to 26.10.16
- Tag autocomplete follows the backend tag grammar: `hello#work` and `C#`
  now match while typing, so the test expectations move with it.
- A titled link (`[url](url "title")`) is no longer treated as a bare URL
  for link-preview cards, since the card would drop its title.
2026-10-17 00:20:58 +08:00
johnnyjoygh e051129f1d chore(brand): adopt SVG bird logo across app and README
Share logo and identity typography across navigation, auth, and About
while preserving custom branding.

Use a transparent blue favicon and Celadon installation icons with
refreshed cache versions.
2026-10-16 09:23:19 +08:00
johnnyjoygh af07ca804c chore(web): bump @usememos/editor to 26.10.15
Quotes and callouts can hold lists, so a quote with a bullet list
renders
instead of showing its Markdown source, and callouts take the Linear and
Notion style: a tinted box with the type's icon.
2026-10-16 07:38:58 +08:00
Johnny 42ae244767 chore(web): bump @usememos/editor to 26.10.14 (#6479) 2026-10-15 20:49:28 +08:00
Johnny 1511fd125d refactor(server): replace Echo with net/http (#6475) 2026-10-15 09:32:02 +08:00
Johnny e0dbf5eeb1 feat(usage): store usage limits as an ordered list of entries (#6472) 2026-10-15 08:01:32 +08:00
Johnny ca4d2a8125 fix(web): keep sidebar menus anchored while scrolling (#6474) 2026-10-15 07:44:31 +08:00
johnnyjoygh 6529609283 chore: bump editor version 2026-10-14 21:09:29 +08:00
Johnny f9d277f6bd chore: switch release versions to YY.MM.N (#6469) 2026-10-14 19:26:59 +08:00
johnnyjoygh 25419a5239 chore: bump memo editor 2026-10-14 09:31:28 +08:00
johnnyjoygh fa90981671 fix(web): load managed attachment images on instances served over http 2026-10-14 08:36:21 +08:00
Johnny 5cfe9c09dd feat(web): replace CodeMirror and react-markdown with @usememos/editor (#6466) 2026-10-14 07:34:48 +08:00
goingforstudying-ctrl 8120a6cee0 fix: SSRF guards still allow 100.64.0.0/10 (CGNAT) destinations (#6256)
Signed-off-by: goingforstudying-ctrl <goingforstudying@gmail.com>
Co-authored-by: goingforstudying-ctrl <258847353+goingforstudying-ctrl@users.noreply.github.com>
Co-authored-by: goingforstudying-ctrl <goingforstudying-ctrl@users.noreply.github.com>
2026-10-13 08:50:43 +08:00
Estelle Poulin 2cd3d09391 chore: use alternative locking syntax that both MySQL and MariaDB support (#6462) 2026-10-13 07:59:21 +08:00
Johnny 2487db7c77 fix(auth): surface PAT store failures instead of a silent 401 (#6461) 2026-10-13 06:52:58 +08:00
johnnyjoygh 6c6c5b79ad fix(auth): invalidate access tokens after password changes 2026-10-12 23:36:58 +08:00
johnnyjoygh 7bdf6f275b chore(auth): show SSO loading state inside the provider button 2026-10-12 23:02:26 +08:00
johnnyjoygh 9e3a164dff feat(usage): add default limits and explicit rule targets
Move memo content size into usage limits, with 8 KiB content and 32 MiB
upload defaults when settings are absent. Represent stored rule targets
with all_users or a positive user_id, and use that same schema for
deployment configuration.

Rename the memo count metric, remove reserved proto declarations, and
renumber fields and enums for the unreleased schema. Synchronize
enforcement, settings UI, generated clients, and tests.
2026-10-12 22:35:39 +08:00
johnnyjoygh a80fe19ee1 chore: fix assets cache 2026-10-12 09:22:58 +08:00
Johnny a668bb8f7e fix(web): stamp new memos with the time of saving under a date filter (#6457) 2026-10-11 22:51:15 +08:00
boojack 7cb288864b refactor: move the upload size limit to usage limits
The instance-wide maximum upload size in the storage setting and the
per-user UPLOAD_BYTES usage limit were two caps on the same thing, with
a
rule that the per-user value could only lower the instance value. The
storage setting field is removed, and the all-users UPLOAD_BYTES usage
limit is the only per-file cap. A user's own limit replaces the default
in either direction, and no limit means any file size.

- Remove upload_size_limit_mb from the API and store storage settings,
  the 32 MiB store default, and the deployment config check.
- Drop the FILE_TOO_LARGE error; every refusal is QUOTA_EXCEEDED with
  metric UPLOAD_BYTES.
- Split usagelimit.CheckFileSize out of CheckUpload and call it from
  memo import, so import is no longer a bypass.
- Remove the Maximum upload size field from the Storage section and the
  instance-limit warning from the usage limits dialog.

The old value is not carried over. Instances that relied on the default
accept any file size until an admin sets a limit.
2026-10-11 22:08:13 +08:00
boojack 1a5886d7c1 feat: add per-user usage limits (#6456) 2026-10-11 21:25:40 +08:00
Johnny d775160283 fix: harden instance admin, health, and mail header handling (#6454) 2026-10-11 10:52:03 +08:00
Garrett Allen fa2dcf59d5 fix: upgrade golang.org/x/net, grpc and Go to 1.27.2 (CVE-2026-78669, CVE-2026-84445) (#6453)
Co-authored-by: johnnyjoygh <johnnyjoygg@gmail.com>
2026-10-11 09:20:42 +08:00
Kunpeng Xie f9c895c51b fix(web): restore list ordering after editing a new memo (#6451) 2026-10-11 09:17:46 +08:00
johnnyjoygh 92ff239988 fix(api): use opaque page token in ListAttachments
ListAttachments was the only list RPC whose page token was a bare decimal
offset. Switch it to the shared PageToken format used by every other
paginated handler so the token also carries the page size and stays
consistent across the API.
2026-10-11 09:06:07 +08:00
kediyalua 91d4a93ec8 fix(api): return attachment page token only when more results exist (#6452)
Signed-off-by: kediyalua <kediyalua@outlook.com>
2026-10-11 08:58:23 +08:00