Commit graph

2920 commits

Author SHA1 Message Date
johnnyjoygh
96cb65320b fix(instance): add needs_setup so admin-less instances aren't treated as fresh
The frontend keyed first-run setup off a null InstanceProfile.admin, but a
null admin only means "no admin-role user exists" — which also happens on a
populated instance that has lost all its admins. Such an instance was wrongly
redirected to signup, where the new account is created as a normal user (the
first-user promotion only triggers when there are zero users), leaving the
instance permanently admin-less.

Add an explicit InstanceProfile.needs_setup derived from user count == 0, and
switch the signup redirect and host tip to use it. admin stays for display only.
2026-06-21 22:14:15 +08:00
johnnyjoygh
6eb17864df feat: surface newly created memo above pinned list 2026-06-21 14:11:46 +08:00
johnnyjoygh
deddf71d7b feat(editor): add focus-mode formatting toolbar
Add a rich-text formatting toolbar as the focus-mode header when the
WYSIWYG editor is active: heading dropdown, bold/italic/code, lists, and
link, with a priority+overflow responsive layout and live active-state
highlighting. The toolbar is a self-contained component driven through a
new FormattingController surface routed via EditorContent.

Remove the now-redundant slash-command feature (/todo, /code, /link,
/table) and its "Type / for commands" hint, since the toolbar covers
those actions; the shared suggestion renderer stays for #tag.
2026-06-21 11:57:45 +08:00
johnnyjoygh
f727ad217c fix(comments): list all memo comments via pagination
Memo detail only showed the first 10 comments: the frontend requested
pageSize=0, which the backend normalizes to DefaultPageSize (10), and the
returned nextPageToken was never followed.

Add useInfiniteMemoComments (mirrors useInfiniteMemos) so the detail page
paginates through every comment, with a "Load more" control in
MemoCommentSection. Page size defaults to DEFAULT_LIST_MEMOS_PAGE_SIZE to
match the memo list convention.
2026-06-21 09:55:37 +08:00
johnnyjoygh
f5a60263b2 chore(ui): align frontend on shadcn kit
Design system:
- add semantic --success/--warning OKLCH tokens across themes; replace
  hardcoded green/amber feedback colors and their manual dark: overrides
- drop the unused @emotion dependency

Kit usage:
- migrate raw <button>/<input> to ui-kit components (actions) or
  <div>/<span> (non-action surfaces); keep genuinely custom looks as
  raw HTML with their own styles
- make kit usage prop-only (no className overrides): add Button
  size="icon-sm", Badge "warning" variant + "pill" shape
- extract a shared Tabs primitive (segmented/underline) and migrate
  Inboxes + UserProfile onto it
- tokenize z-index tiers as z-overlay/z-dropdown/z-tooltip
- export variant types (ButtonVariant/Size, BadgeVariant/Shape, TabsVariant)
- document the kit and its policy in components/ui/README.md
2026-06-21 09:17:04 +08:00
boojack
f0e4a5624f feat(filter): expand CEL filter surface with startsWith/endsWith, matches(), and all()
Let users write three more CEL constructs in the filter field, each compiled to
SQL across SQLite/MySQL/Postgres:

- Scalar startsWith()/endsWith() on content/filename/mime_type (case-insensitive)
- matches() regex: PG ~, MySQL/SQLite REGEXP (Go-backed SQLite fn), validated at
  compile time via cel.ValidateRegexLiterals()
- all() comprehension over tags via per-element subqueries, non-empty required

Also: contains() now escapes LIKE metacharacters (%, _, \); cross-dialect render
tests plus behavioral tests; cel-go bumped to v0.28.1; new operators surfaced in
the frontend shortcut guide.
2026-06-15 23:22:28 +08:00
boojack
817561df8f fix(editor): collapse lingering select-all selection after delete
Ctrl+A creates a whole-document AllSelection; deleting it (Backspace, Delete, or Cut) maps the AllSelection onto the now-empty paragraph instead of collapsing to a caret, so the view paints a "selected" empty block. A ProseMirror appendTransaction now collapses a leftover AllSelection to a caret after any doc-changing edit.
2026-06-15 09:33:16 +08:00
ManJieqi
46685b1906
chore: update Chinese translations in zh-Hans.json (#6033)
Signed-off-by: ManJieqi <40858189+manjieqi@users.noreply.github.com>
2026-06-14 23:23:18 +08:00
boojack
00225db922 refactor(web): share markdown element styles between viewer and editor
Extract the Tailwind classes for common markdown elements (paragraph,
blockquote, lists, inline code, link, hr, headings) into a single
markdownStyles.ts consumed by both the read-only MemoContent components
and the WYSIWYG editor, replacing the duplicated per-element strings and
the .memo-wysiwyg CSS block. Heading classes are precomputed per level so
the hot renderHTML path is a lookup, not a cn() merge.

Also require at least one character after `#` before opening the tag
suggestion menu so a bare `#` (or `# ` heading) no longer conflicts with
markdown headings.
2026-06-13 22:17:00 +08:00
boojack
2c0efeba7c refactor(web): rename editor dirs and simplify raw mode to a plain textarea 2026-06-13 01:08:38 +08:00
boojack
797f1ff15d
feat(web): markdown WYSIWYG editor with raw-mode toggle (#6030)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:34:51 +08:00
Yiges.M.x.
063a44498d
feat: add optional webhook signing secret (Standard Webhooks HMAC-SHA256) (#6013) 2026-06-09 22:45:01 +08:00
boojack
1052c04d33 fix(web): improve mobile control spacing 2026-06-09 21:04:47 +08:00
boojack
418398587c feat(i18n): add searchable locale picker 2026-06-09 09:33:17 +08:00
boojack
a47d04954e feat(i18n): expand European locale coverage 2026-06-09 09:07:28 +08:00
boojack
ecbe2ab797 fix(memo): preserve expanded todo list state 2026-06-08 19:11:29 +08:00
ay5399
8f1377324f
fix(editor): wire Ctrl+B and Ctrl+I markdown shortcuts to textarea (#6016)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2026-06-08 00:24:05 +08:00
boojack
9eabb554d5
feat(settings): move tag metadata to user settings (#6017) 2026-06-07 23:58:00 +08:00
boojack
a50ce09e81 fix(markdown): ignore tags inside links 2026-06-06 00:01:28 +08:00
boojack
0e2a9a9c0c fix(web): render video attachment posters on mobile 2026-06-02 23:08:16 +08:00
boojack
0d31e3c2fb chore(media): add zoom controls to preview dialog 2026-06-02 22:46:07 +08:00
boojack
53abb8020e refactor(frontend): remove react-use dependency 2026-05-31 18:32:17 +08:00
boojack
7c3bff4e98 fix(markdown): keep task item content in one grid column 2026-05-27 23:57:23 +08:00
boojack
e0bb3a2e68 fix(editor): wrap selected text when pasting URL 2026-05-27 20:36:27 +08:00
boojack
648b3bd812
feat(memo): add task list quick actions (#5983) 2026-05-27 09:13:55 +08:00
boojack
e564c1a993 chore: update about page 2026-05-26 21:14:59 +08:00
boojack
439ddaebf5 refactor(placeholder): extract tile sprite strip 2026-05-14 20:38:00 +08:00
boojack
411ba7b34c feat(about): add about page with bird sprites 2026-05-14 20:30:37 +08:00
boojack
638e4f398e feat(placeholder): add woodpecker tilemap 2026-05-14 09:35:11 +08:00
boojack
cf55f11072 feat(frontend): add pixel bird tilemaps 2026-05-14 00:03:21 +08:00
boojack
ca2bc4eb84 chore: render placeholder ascii pieces as components 2026-05-13 09:06:23 +08:00
boojack
aa5cb455e9 refactor(web): use / as the home route instead of /home
Home now lives at `/` directly. Unauthenticated visitors are sent to
`/explore` by the landing gate; old `/home` URLs redirect to `/` for
bookmark compatibility.
2026-05-12 23:17:46 +08:00
boojack
8c16ffa1f1
feat: add <Placeholder> component with ASCII bird states (#5949)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:48:37 +08:00
boojack
a6024eebf1
perf: lazy load heavy first-screen dependencies (#5947) 2026-05-12 20:11:39 +08:00
boojack
f3f059b2f7 chore: add batch get settings API 2026-05-09 09:30:28 +08:00
boojack
21303e879d fix(sse): stream initial response and refresh tokens 2026-05-09 09:15:50 +08:00
boojack
88ac3ec31e feat(stats): support filtered all-user stats
- Add state and filter inputs to ListAllUserStats and reuse it for explore/archive sidebar stats.
- Reduce duplicate home initialization requests by sharing stats/settings data paths.
- Include memo paragraph regression coverage from the current working tree.
2026-05-09 09:11:04 +08:00
boojack
1df6479443
feat: add dedicated shortcuts page (#5942) 2026-05-08 23:06:12 +08:00
boojack
b6f42cbe6b
chore: upgrade frontend to React 19 (#5940) 2026-05-08 22:10:48 +08:00
hchengting
bcbcb03894
chore: update zh-Hant translation (#5930) 2026-05-04 20:18:00 +08:00
boojack
5ccba98adc
refactor: split STT and Audio-LLM into separate interfaces (#5928) 2026-05-03 00:21:58 +08:00
boojack
238f27dea1
feat(transcription): explicit STT settings with provider, model, prompt (#5926) 2026-05-02 19:35:18 +08:00
boojack
ef55013418
feat(memo): create memos on the selected calendar date (#5925) 2026-05-02 11:53:50 +08:00
Steven
d349fe4409 chore(theme): rebalance dark palette for readability 2026-05-02 09:11:46 +08:00
Steven
8daef1dc89 feat(activity-calendar): aggregate by ViewContext.timeBasis
Fixes the inconsistency where switching the memo list to update_time
left the activity heatmap aggregating by created_time. The heatmap
now follows the same time basis as the list it sits next to.

Backend
- UserStats gains memo_updated_timestamps (additive proto field, tag 8).
- GetUserStats and ListAllUserStats populate it alongside the existing
  memo_created_timestamps. No DB migration; memo.updated_ts already
  exists on every row.

Frontend
- useFilteredMemoStats reads timeBasis from ViewContext and selects
  the matching timestamp source.
- StatisticsView and MonthNavigator forward timeBasis through to
  MonthCalendar / YearCalendar so tooltip text matches the basis
  ("X memos in DATE" vs "X memos updated on DATE").
- Falls back to memoCreatedTimestamps when an old server returns an
  empty memoUpdatedTimestamps array (detected by length divergence,
  since protobuf-es deserializes missing repeated fields as []).

Tests
- Backend: TestGetUserStats_MemoUpdatedTimestamps verifies the field
  is populated and reflects post-creation updates.
- Frontend: filtered-memo-stats covers create/update source switching
  and the old-server fallback path; activity-calendar-tooltip covers
  basis-aware label selection.

Spec and implementation plan committed under docs/superpowers/.
2026-05-02 00:26:53 +08:00
Steven
ea0625da45 feat(stats): admin instance resource statistics 2026-05-01 23:15:56 +08:00
Steven
cd4f28ae10 feat(notification): add smtp email settings
- Add admin notification email settings UI and test-email RPC
- Dispatch privacy-first comment and mention emails through server notification layer
- Keep SMTP secrets write-only and require passwords when SMTP identity changes
2026-05-01 18:48:21 +08:00
Steven
a0b6417689 chore: bump pnpm to 11.0.1 and align list test assertions 2026-04-30 20:05:39 +08:00
boojack
e008b1a23c fix(markdown): align list items with checkboxes 2026-04-30 08:49:49 +08:00
boojack
0bc56694b0 feat: render link metadata cards 2026-04-29 23:23:52 +08:00
boojack
9c5c604944 feat: add link metadata endpoints 2026-04-29 22:38:08 +08:00
memoclaw
267f90a3ff
chore: refactor Settings UI structure (#5912)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-29 09:30:58 +08:00
boojack
14480bfc46 chore(settings): improve storage tags and memo panels 2026-04-28 23:28:01 +08:00
boojack
ee65e90a39
chore: upgrade pnpm to 11 (#5911) 2026-04-28 22:16:22 +08:00
Chyna
328396a97f
fix(web): sync avatar changes immediately after profile update (#5903)
Signed-off-by: Chyna <68607983+chyna-gvng@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-04-28 21:57:58 +08:00
Mostafa Attia
9353848603
chore: increased muted text contrast in dark theme (#5902) 2026-04-28 20:03:24 +08:00
boojack
616487fa37
chore: update backend and frontend dependencies (#5900)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-28 08:25:26 +08:00
boojack
18e729fe00 chore(memo): simplify markdown task list rendering 2026-04-27 23:22:29 +08:00
boojack
9e310bf93c chore(memo): clarify displayed update time 2026-04-27 21:50:41 +08:00
boojack
94ce1e5347 chore(settings): show build commit in version info 2026-04-27 08:51:11 +08:00
boojack
e2c60845ea fix(markdown): split mixed task and bullet lists 2026-04-26 23:25:29 +08:00
boojack
c268551a16
feat(memos): choose created or updated time for memos (#5894) 2026-04-26 11:50:26 +08:00
boojack
3949a252db style(web): refine scrollbar styling 2026-04-26 00:24:45 +08:00
boojack
34c90dd5e1 chore: remove duplicate tags from share image preview 2026-04-25 22:22:49 +08:00
boojack
ee1799851e
feat: redesign account and SSO management (#5886) 2026-04-24 09:08:58 +08:00
boojack
30c0611a82
fix: fix legacy username auth flows (#5885) 2026-04-23 22:35:38 +08:00
boojack
d688914b28
feat(auth): add SSO user identity linkage (#5883) 2026-04-23 08:51:45 +08:00
boojack
50638040f6
fix: reduce list memo query overhead (#5880) 2026-04-22 09:31:48 +08:00
boojack
b5863d76be
fix(web): preserve task checkbox state (#5867) 2026-04-20 23:27:00 +08:00
wndnjs0
d98f665919
fix: disable modal prop on DropdownMenu to prevent scroll disappearing (#5861) 2026-04-20 21:38:28 +08:00
boojack
88cb58ab64
refactor(web/routing): guard-based auth flow, migrate tests to Vitest (#5848) 2026-04-18 01:06:54 +08:00
Mattia Borda
5be530dbac
chore: update Italian translation for 'cancel' key (#5841)
Signed-off-by: Mattia Borda <mattiagiovanni.borda@icloud.com>
2026-04-15 21:01:57 +08:00
boojack
411d8335e7
chore: set native color scheme for dark themes (#5840) 2026-04-15 20:55:41 +08:00
boojack
a3a5b52d60 chore: tweak location picker 2026-04-15 20:07:36 +08:00
boojack
ab5332901f fix: hide transcribe button without AI provider 2026-04-14 21:47:59 +08:00
boojack
35504cc8bd
feat(web): add demo mode banner (#5836) 2026-04-14 09:08:17 +08:00
boojack
101704c8ea
feat(ai): add BYOK audio transcription (#5832) 2026-04-13 22:09:24 +08:00
boojack
0ad0fec8d4 feat(ai): add Anthropic provider option 2026-04-12 21:42:17 +08:00
memoclaw
d87539a1e1
feat: add Gemini transcription provider (#5830)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-12 21:12:03 +08:00
memoclaw
83ed32f119
feat(ai): add instance AI providers and transcription (#5829)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-12 19:23:34 +08:00
boojack
efeb28c872 fix: remove duplicate Japanese locale keys 2026-04-12 10:34:20 +08:00
Takuro Onoue
0f7c7eb75e
i18n: refine and normalize Japanese locale strings (#5826)
Signed-off-by: Takuro Onoue <kusanaginoturugi@gmail.com>
2026-04-11 22:15:26 +08:00
boojack
2523d966f4 chore(web): improve navigation accessibility 2026-04-10 22:27:29 +08:00
boojack
8cdcd7b284 refactor(attachments): extract visual gallery layout and tile style tokens 2026-04-10 08:55:20 +08:00
boojack
9ca71229a6 fix: preserve draft content when tab is suspended or editor remounts
Gate auto-save on initialization to prevent empty content from overwriting
cached drafts on remount. Flush drafts synchronously on visibilitychange/
pagehide so Chromium tab suspension cannot drop pending debounced saves.
Restore cached draft over saved memo content when they differ (inline editing).
2026-04-10 08:48:50 +08:00
boojack
938c405b0f refactor: move embedded content styles from global CSS to Tailwind 2026-04-08 23:34:49 +08:00
boojack
124708f164 chore: refactor attachment media layout and insert menu organization 2026-04-08 23:28:49 +08:00
boojack
7e21b728b3 fix: harden memo content iframe and HTML sanitization 2026-04-08 21:10:35 +08:00
boojack
2d682ae176 refactor(attachments): compact audio item layout and playback logic
Made-with: Cursor
2026-04-07 21:47:06 +08:00
boojack
5b78023fd5 Polish share-as-image UI and sidebar sharing actions
Made-with: Cursor
2026-04-07 21:07:40 +08:00
boojack
e51985a29f
feat(memo-editor): add compact live waveform recorder panel (#5817) 2026-04-07 20:40:34 +08:00
boojack
61c963841b chore(web): polish dark theme and calendar UI
- simplify ActivityCalendar state handling and shared max-count utilities
- remove calendar ring styling and darken the default dark theme primary colors
- tighten the audio recorder panel layout and action sizing
2026-04-06 22:44:11 +08:00
memoclaw
24fc8ab8ca
feat(mentions): add memo mention parsing, notifications, and rendering (#5811)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-06 22:16:53 +08:00
boojack
38fc22b754 feat(memo): add image sharing in detail view
Keep the unpublished image-sharing flow scoped to memo detail pages.

- add a dedicated share-image preview and export pipeline
- measure the rendered memo card so preview and exported image stay aligned
- move the entry point into the detail sidebar and drawer only
2026-04-06 18:30:01 +08:00
boojack
2cbc70762b refactor(attachments): simplify the attachment library
- split attachment page states and primitives into focused components
- unify card and list item presentation across media, audio, documents, and unused uploads
- move attachment paging and cleanup flows onto shared query and view-model hooks
2026-04-06 17:39:58 +08:00
boojack
7ac9989d43 fix(map): align dark mode map styling 2026-04-06 17:38:56 +08:00
boojack
15d8ec10d5 chore: update locale translations for new i18n entries 2026-04-06 16:11:21 +08:00
boojack
067d7ff0ce chore: refactor memo editor audio recording flow 2026-04-06 15:46:38 +08:00
boojack
aafcc21ae6 fix: improve image preview dialog and live photo trigger 2026-04-06 13:41:27 +08:00
boojack
6b0487dcd8 fix: unify live photo previews around LIVE badge playback 2026-04-06 11:56:58 +08:00
boojack
4b4e719470
feat(attachments): add Live Photo and Motion Photo support (#5810) 2026-04-06 10:47:01 +08:00
boojack
894b3eb045 fix(map): refine Leaflet controls and memo map styling 2026-04-06 08:45:54 +08:00
memoclaw
f403f8c03c refactor: simplify memo metadata components 2026-04-02 22:30:21 +08:00
memoclaw
0e4d2d25ca refactor: simplify audio attachment playback component 2026-04-02 21:56:01 +08:00
Serhat
9676e72533
i18n: complete Turkish (tr) translations to 100% coverage (#5802)
Signed-off-by: Serhat <49079271+onwp@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-04-01 19:25:18 +08:00
memoclaw
c0d5854f67
feat(editor): add voice note recording to the memo composer (#5801)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-04-01 09:36:33 +08:00
memoclaw
a0d83e1a9e fix(web): refine attachment media layout 2026-04-01 08:40:36 +08:00
memoclaw
63a17d897d refactor: split audio attachment view into reusable components 2026-03-31 23:03:38 +08:00
memoclaw
1921b57662
fix(tags): allow blur-only tag metadata (#5800)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-31 21:38:55 +08:00
memoclaw
e520b637fd fix: prevent stale comment drafts from being restored 2026-03-30 22:37:07 +08:00
memoclaw
c53677fcba fix(api): improve SSE hub design and fix double-broadcast on comments
- Fix duplicate SSE event on comment creation: CreateMemoComment now
  suppresses the redundant memo.created broadcast from the inner
  CreateMemo call, emitting only memo.comment.created
- Extract reaction event-building IIFEs into buildMemoReactionSSEEvent
  helper, removing duplicated inline DB-fetch logic
- Promote resolveSSEAudienceCreatorID from method to free function
  (resolveSSECreatorID) since it never used the receiver
- Add userID to SSE connect/disconnect log lines for traceability
- Change canReceive default from permissive (return true) to
  deny-with-warning for unknown visibility types
- Add comprehensive tests covering all new helpers, visibility edge
  cases, slow-client drop behavior, and the double-broadcast fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 07:33:40 +08:00
memoclaw
acddef1f3d
fix(api): switch user resource names to usernames (#5779)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-25 09:11:17 +08:00
memoclaw
4f6730a12e chore: show compact attachment count instead of thumbnails in comment previews
When truncate mode is active (comment list), display an inline file icon
with attachment count instead of rendering full image thumbnails.
2026-03-24 19:30:39 +08:00
memoclaw
6a03917f6e chore: upgrade TypeScript to 6.0.2 2026-03-24 08:45:56 +08:00
memoclaw
bb7f4978e5
refactor(web): consolidate SharedMemo into MemoDetail (#5773)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-24 08:40:49 +08:00
memoclaw
6b30579903
feat: add outline navigation to memo detail sidebar (#5771)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 00:20:40 +08:00
memoclaw
2aaca27bd5
refactor(web): improve MemoDetail and sidebar maintainability (#5769)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-23 22:51:24 +08:00
memoclaw
e176b28c80
feat(memo-preview): support comment metadata in previews (#5768)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-23 21:51:30 +08:00
memoclaw
22519b57a0 fix(web): prevent MemoContent prop leaks 2026-03-23 20:34:14 +08:00
memoclaw
45b21530d9
feat: add blur_content attribute to tag metadata settings (#5767)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 19:42:27 +08:00
memoclaw
9e04049632
feat: treat tag setting keys as anchored regex patterns (#5759)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-22 08:07:45 +08:00
memoclaw
9ded59a1aa
refactor(web): improve Settings page maintainability and consistency (#5757)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-21 15:05:48 +08:00
memoclaw
d5de325ff4
refactor(web): simplify main layout sidebar structure (#5756)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-21 12:54:18 +08:00
memoclaw
4177898054
refactor(web): consolidate memo metadata components into MemoMetadata (#5755)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-21 09:04:15 +08:00
memoclaw
ac077ac3d3
refactor(web): improve MemoView and MemoEditor maintainability (#5754)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-21 07:20:18 +08:00
memoclaw
7b4f3a9fa5 refactor(memo): simplify MemoDetail error handling, drop memo.failed-to-load i18n key
The failed-to-load key was only used for non-ConnectError exceptions, which
are unreachable in practice since the Connect RPC client always wraps errors
as ConnectError. Use (error as Error).message as a plain fallback instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-20 20:19:44 +08:00
memoclaw
5f6f624635 i18n: add missing auth.protected-memo-notice and memo.failed-to-load fallbacks to all locales
30 locale files were missing the two keys added in the auth redirect PR.
Added English fallback strings so all locales render properly until
community translations are contributed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-20 19:41:12 +08:00
xun zhao
7601708ae4
Redirect unauthenticated protected memo access to sign in (#5738) 2026-03-20 19:40:19 +08:00
fiatcode
551ee1d81f
fix(auth): recover session via refresh cookie when localStorage is empty (#5748) 2026-03-20 19:21:11 +08:00
memoclaw
be00abe852
fix: sync html lang attribute with active locale (#5753)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-20 19:17:30 +08:00
google-labs-jules[bot]
23a7e99a21
chore: optimize unreact network requests (#5747)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2026-03-20 18:08:28 +08:00
memoclaw
a7cabb7ce6
refactor(web): remove masonry memo layout (#5746)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-20 09:01:43 +08:00
memoclaw
05810e7882
fix(memo-editor): scope Cmd+Enter save to the active editor (#5745)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-20 08:43:01 +08:00
memoclaw
e0334cf0a8
refactor: restructure i18n locale keys for better maintainability (#5744)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-20 05:56:56 +08:00
memoclaw
6f1f3d81c5
chore: remove disallow_public_visibility setting (#5743)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-20 00:00:51 +08:00
memoclaw
3f3133d6e2
feat(memo): add share links for private memos (#5742)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-19 23:47:22 +08:00
memoclaw
a249d06e2e
feat(instance): add notification transport setting (#5737)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-19 09:18:28 +08:00
boojack
65d14fbb63
feat(instance): add canonical tag metadata setting (#5736) 2026-03-19 08:54:43 +08:00
boojack
330291d4d9
feat(user): add per-user tag metadata settings (#5735) 2026-03-18 23:15:14 +08:00
boojack
04f239a2fc
fix(api): remove public activity service (#5734) 2026-03-18 22:42:57 +08:00
Nix
89c6902895
feat(i18n): update sse connect label in Chinese (#5732) 2026-03-18 18:53:09 +08:00
memoclaw
6f5f0d94e8
chore(web): update frontend dependencies and Node runtime (#5729) 2026-03-16 20:37:16 +08:00
memoclaw
1e688b2a5d
feat: extract title from first H1 heading into memo property (#5726)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 11:05:03 +08:00
memoclaw
8f43e8075b
fix: correct typos in comments, error messages, and identifiers (#5704)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:40:17 +08:00
memoclaw
bdd3554b89
fix: handle chunk load errors after redeployment with auto-reload (#5703)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:45:16 +08:00
memoclaw
2ccb98a6cb
fix: render audio attachments as inline players (#5699)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:57:48 +08:00
memoclaw
4503679155
enhance: improve link memo dialog with rich previews (#5697)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:54:13 +08:00
memoclaw
e70149af5f
enhance: polish PWA manifest and meta tags (#5695)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:02:13 +08:00
memoclaw
3d4f793f97
fix: include plain URLs and tags in memo snippet generation (#5688)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:03:45 +08:00
memoclaw
92d937b1aa
feat: replace auto-increment ID with UID for identity provider resource names (#5687)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:01:22 +08:00
Peter Etelej
3010f10eaf
fix: access token refresh on web app (#5681) 2026-03-05 19:29:21 +08:00
longhe.li
0729779e04
fix: toggle focus mode do not reset editor height (#5504)
Signed-off-by: longhe.li <lilonghe@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 22:13:58 +08:00
thefatcode
2c3f9e3bfb
fix: clear content search filter when selecting shortcut (#5499) 2026-03-04 22:12:41 +08:00
Steven
ce441644af fix: ensure comment divs span full width in MemoDetail 2026-03-04 19:13:58 +08:00
Steven
0cf8805184 refactor(sse): move status indicator to avatar badge
Replace the standalone SSE dot above UserMenu with a small badge
overlaid on the bottom-right of the user avatar. Only visible when
status is connecting (yellow) or disconnected (red) — invisible in the
normal connected state, removing constant visual noise.
2026-03-03 23:25:01 +08:00
milvasic
ea0892a8b2
feat: add live refresh via Server-Sent Events (SSE) with visual indicator (#5638)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: milvasic <milvasic@users.noreply.github.com>
2026-03-03 22:56:12 +08:00
Steven
a69e405c95 refactor: remove dead code and deduplicate comment amount logic 2026-03-03 22:30:25 +08:00
Steven
3a5d3c8ff9 feat: show inline comment preview in list view
Add a comment preview section below memo cards in list view, displaying
up to 3 comment snippets with a "View all" link. Removes the old comment
count icon from the memo header in favor of this richer inline display.
Comment preview is hidden in memo detail view.
2026-03-03 21:40:56 +08:00
Steven
3e4c052f44 chore: unify table style 2026-03-03 21:07:28 +08:00
Steven
4321887a02 chore: fix linter 2026-03-03 08:50:57 +08:00
Lincoln Nogueira
d0764fb0be
i18n: update all locale translations (#5679) 2026-03-03 08:49:08 +08:00
Steven
98859eb5e5 fix(routing): redirect unauthenticated users to /explore when public visibility is allowed 2026-03-03 08:48:54 +08:00
Steven
737acbba2f fix(markdown): support height/width attributes on img elements 2026-03-02 22:45:36 +08:00
Steven
dfab67f035 chore(seed): polish demo data with realistic multi-user content 2026-03-02 21:50:47 +08:00
Steven
6b37fcc01b fix: improve KaTeX and Mermaid error handling and overflow 2026-03-02 21:11:07 +08:00
Steven
7f753bf6d7 refactor(theme): consolidate theme system and polish dark mode colors
- Reduce themes from 6 to 4: system, light, dark, paper
  - Remove midnight (too similar to dark) and whitewall (too similar to light)
  - Drop all unused tokens: chart-*, sidebar-primary, sidebar-border,
    sidebar-ring, shadow-2xs, tracking-normal, spacing
  - Remove redundant @theme inline blocks from dynamic theme files
    (Tailwind only processes them at compile time, not at runtime)
  - Move shared tokens (fonts, radius) to default.css only

- Polish dark mode color palette
  - Consistent cool-slate hue (h265) across all surfaces
  - Proper surface layering: sidebar(0.07) → bg(0.09) → card(0.13) →
    popover(0.17) → secondary(0.19) → muted(0.21) → accent(0.22)
  - Foreground softened to 0.82 (from 0.9) — comfortable off-white
  - Accent more chromatic than muted (0.012 vs 0.008) — hover feels interactive
  - Popover elevated above card (0.17 vs 0.13) — floating elements visible
  - Destructive more vivid (0.62/c0.20) — clearly red on dark surfaces
  - Input border (0.25) more distinct than layout border (0.21)
  - Sidebar foreground (0.68) dimmer than content foreground (0.82)

- Fix inline code background invisible in dark mode (#5674)
  - Muted was same lightness as card — increased to 0.21 for clear contrast
2026-03-02 09:30:57 +08:00
Johnny
16576be111 chore: polish MemoDetailSidebar for consistent structure and styles 2026-03-01 21:22:11 +08:00
Johnny
53a8a436ba chore: fix frontend linter 2026-03-01 19:51:52 +08:00
Johnny
026ea92f7b fix(editor): show newly linked memos when editing a memo with attachments 2026-03-01 19:16:57 +08:00
mostapko
104d2ec0a6
feat(ui): allow navigating between images with arrows in preview dialog (#5669) 2026-03-01 11:30:47 +08:00
Steven
664b8c5629 fix(ui): unify metadata component styles across MemoView and MemoEditor
Align header padding, text color, background tokens, and item row styles
across CodeBlock, AttachmentList, RelationList, and LocationDisplay so all
metadata panels follow the same visual pattern.
2026-02-26 23:18:11 +08:00
milvasic
6b0736b293
fix(ui): show comment editor above the comment list (#5662) 2026-02-26 08:50:27 +08:00
Steven
f7ac6a0191 refactor: auth token refresh flow and simplify user hooks 2026-02-25 22:08:18 +08:00
Steven
333c9df233 fix(web): refresh memo detail cache after editor save 2026-02-25 20:03:09 +08:00
Steven
bbdc998646 fix(web): use BroadcastChannel to sync token refreshes across tabs
When multiple tabs are open and a token expires, each tab independently
attempts a refresh. With server-side token rotation this causes all but
the first tab to fail, logging the user out.

Add a BroadcastChannel (memos_token_sync) so that when any tab
successfully refreshes, it broadcasts the new token to all other tabs.
Receiving tabs adopt the token in-memory immediately, skipping their own
refresh request and avoiding conflicts with token rotation.

Falls back gracefully when BroadcastChannel is unavailable (e.g. some
privacy modes).
2026-02-24 23:31:59 +08:00
Steven
9ecd7b876b fix(web): fix spurious logout on page reload with expired access token
Two bugs caused users to be redirected to /auth too frequently:

1. Race condition in Promise.all([initInstance(), initAuth()]):
   initInstance() makes a gRPC request whose auth interceptor calls
   getAccessToken() synchronously. When the access token was expired,
   getAccessToken() eagerly deleted it from localStorage as a "cleanup"
   side-effect. By the time initAuth() ran and checked hasStoredToken(),
   localStorage was already empty, so it skipped the getCurrentUser()
   call and the token refresh cycle entirely — logging the user out even
   when the refresh-token cookie was still valid. Fix: remove the
   localStorage deletion from getAccessToken(); clearAccessToken()
   (called on confirmed auth failure and logout) handles proper cleanup.

2. React Query retry: 1 caused a second refresh+redirect attempt after
   auth failures. The auth interceptor already handles token refresh and
   request retry internally. If it still throws Unauthenticated, the
   redirect is already in flight — a React Query retry only fires another
   failed refresh and a redundant redirectOnAuthFailure() call. Fix: use
   a shouldRetry function that skips retries for Unauthenticated errors
   while keeping the existing once-retry behaviour for other errors.
2026-02-23 14:08:59 +08:00
Steven
03c30b8ccb fix(web): fix explore page showing private tags and improve stats hook
The explore page sidebar was showing tags from the current user's private
memos because the default ListMemos query applies a server-side OR filter
(creator_id == X || visibility in [...]), mixing private content in.

Fix by using a visibility-scoped ListMemos request in the explore context
so private memos are always excluded via the AND'd server auth filter.

Also consolidate two always-firing useMemos calls into one context-aware
query, unify activity stats computation with countBy across all branches,
and extract a toDateString helper to remove duplicated formatting logic.
2026-02-23 13:15:01 +08:00
Steven
1cea9b0a78 fix(web): make MonthNavigator month label reactive to language changes
Use useTranslation() hook instead of the static i18n import so that
the month label re-computes when the language changes.
2026-02-23 11:04:04 +08:00
Steven
17fc8383df fix(web): improve MemoEditor layout and timestamp popover styling 2026-02-23 10:20:00 +08:00
Steven
c3061002f3 fix(web): persist auth token in localStorage for cross-tab sessions
Switch from sessionStorage to localStorage so the auth token survives
across tabs and browser restarts, matching standard platform behavior.
Also guard the signup redirect in App.tsx behind profileLoaded to avoid
a false redirect when the instance profile fetch fails.
2026-02-22 13:55:46 +08:00
Steven
4aaebc507e fix(web): skip GetCurrentUser on init when no token is stored
When no token exists in sessionStorage, AuthContext.initialize() was
still calling GetCurrentUser, triggering the auth interceptor to attempt
RefreshToken and retry — producing a burst of 5+ auth API calls in under
a second that reverse proxies with rate limiting (e.g. CrowdSec) flag as
brute force.

Add hasStoredToken() to auth-state and bail out of initialize() early
when there is definitively no session to restore. The refresh flow for
expired tokens is preserved since hasStoredToken() checks for presence
regardless of expiry.

Fixes #5647
2026-02-22 13:40:34 +08:00
Steven
b8bca6bacf fix(web): scope task list item index to memo content container
The closest() selector was targeting a CSS class that never existed on
the container, causing fallback to document.body and collecting task
items across all visible memos. This caused index collisions when
multiple memos with todo lists were on the page.

Adds data-memo-content attribute to the container and updates the
selector accordingly.

Fixes #5635
2026-02-22 13:20:29 +08:00
Steven
2ab476ef2e fix(web): memoize useNavigateTo to prevent infinite view transition loop
Wrapping the returned function in useCallback prevents a new reference
on every render, which was causing an infinite startViewTransition loop
on the initial signup page (fresh install with no admin).

Fixes #5626
2026-02-22 13:16:59 +08:00
Steven
6eaab52e48 fix(web): handle delete memo errors and only run post-delete actions on success 2026-02-22 13:00:36 +08:00
milvasic
1d9d4cd797
fix: invalidate comments query on comment reaction and delete (#5641) 2026-02-22 12:58:56 +08:00
Kaki021
122ac94273
fix(web): ensure default memo visibility is correctly applied (#5623) 2026-02-14 16:58:58 +08:00
Steven
861b58cbf3 refactor(web): extract NsfwOverlay into standalone component with flexbox centering 2026-02-12 23:19:54 +08:00
Steven
aeb1e5fe40 perf(web): eliminate redundant fetch when opening inline memo editor 2026-02-12 23:02:25 +08:00
Johnny
6402618c26 feat(web): replace EditableTimestamp with inline editor timestamp popover 2026-02-11 23:45:53 +08:00
Johnny
566fdccae6 fix(web): allow calendar year picker to go back to 1970 2026-02-11 22:58:25 +08:00
Johnny
177a74e82b fix: allow ampersand in tags to support compound tags 2026-02-11 22:55:45 +08:00
Steven
47e2ace690 fix(web): redirect to auth page instead of explore on session expiry
Fixes #5617
2026-02-10 21:15:44 +08:00
MuLingQwQ
b5108b4f97
fix(web): calendar navigation should use current page path (#5605) 2026-02-09 20:40:12 +08:00
Johnny
f827296d6b chore: fix broken links 2026-02-08 19:46:03 +08:00
Johnny
c4176b4ef1 fix: videos attachment 2026-02-07 16:03:52 +08:00
Steven
81ef53b398 fix: prevent 401 errors on window focus when token expires
Fixes #5589

When the page returns from background to foreground after the JWT
token expires (~15 min), React Query's automatic refetch-on-focus
triggers multiple API calls simultaneously. These all fail with 401
Unauthorized, leaving the user with empty content.

Solution:
- Add useTokenRefreshOnFocus hook that listens to visibilitychange
- Proactively refresh token BEFORE React Query refetches
- Uses 2-minute buffer to catch expiring tokens early
- Graceful error handling - logs error but doesn't block

Changes:
- Created web/src/hooks/useTokenRefreshOnFocus.ts
- Updated isTokenExpired() to accept optional buffer parameter
- Exported refreshAccessToken() for use by the hook
- Integrated hook into AppInitializer (only when user authenticated)
2026-02-05 22:14:48 +08:00
Steven
cf65f0867b refactor: remove hide-scrollbar utility
Removed the hide-scrollbar CSS class and all its usages throughout the
codebase. Hiding scrollbars can hurt UX by making it unclear when
content is scrollable.

Changes:
- Removed hide-scrollbar CSS definition from index.css
- Removed hide-scrollbar class from Navigation component (2 instances)
- Removed hide-scrollbar class from MemoDetailSidebar (2 instances)
- Removed hide-scrollbar class from TagsSection
- Removed hide-scrollbar class from ShortcutsSection

Components now use standard browser scrollbar behavior, which provides
better visual feedback to users about scrollable content. Modern
browsers already handle scrollbar appearance elegantly.
2026-02-04 20:24:54 +08:00
Steven
74b63b278c perf: disable tooltips in year calendar to fix lag
Fixed issue #5579 where the calendar selection dialog was very laggy.

The root cause was rendering ~365 individual Tooltip components when
opening the year calendar view (one per day with activity). This created
a huge number of DOM nodes and event listeners that caused significant
performance issues.

Changes:
- Added disableTooltips prop to MonthCalendar and CalendarCell components
- Disabled tooltips in YearCalendar's small month views
- Removed unnecessary TooltipProvider wrapper in YearCalendar
- Tooltips remain enabled in the default month calendar view

Performance improvements:
- Eliminates ~365 tooltip instances when dialog opens
- Reduces initial render time significantly
- Makes dialog interactions smooth and responsive

Users can still click on dates to drill down for details if needed.
2026-02-04 20:14:55 +08:00
Steven
e7605d90da fix: shortcut edit button opens create dialog instead of edit dialog
Fixed issue #5576 where clicking the edit button on a shortcut would
incorrectly open a create dialog instead of an edit dialog.

The root cause was an incorrect useEffect that was watching the shortcut
state itself instead of the initialShortcut prop. When the dialog was
opened for editing, the state wasn't properly reinitializing with the
existing shortcut data.

Changed the useEffect to:
- Watch initialShortcut as the dependency
- Reinitialize the shortcut state when initialShortcut changes
- Properly distinguishes between create (initialShortcut undefined) and
  edit (initialShortcut has data) modes
2026-02-04 20:03:53 +08:00
memory_clear
f9bf903eea
chore: update access token deletion message description for zh-Hans (#5573)
Signed-off-by: memory_clear <83893503+MemoryClear@users.noreply.github.com>
2026-02-04 19:54:51 +08:00