Commit Graph

2952 Commits

Author SHA1 Message Date
bluedbird eab07d8081 refactor(export): rename Memo Archive to Memos Export Format
Avoid confusion with archived memos while preserving legacy ZIP imports. Move Export & Import to the end of basic settings.
2026-09-20 00:37:50 +08:00
bluedbird 2204eceeef fix(i18n): sync translations and remove unused locale keys 2026-09-20 00:09:27 +08:00
bluedbird 7e3d3c6315 fix(web): limit comment menus to relevant actions 2026-09-19 00:33:01 +08:00
kalelovic fa5e55dfc1 fix(web): toggle numbered task list items correctly (#6346)
Co-authored-by: kalelooz <212041863+kalelooz@users.noreply.github.com>
2026-09-19 00:22:27 +08:00
boojack 4f46523758 chore: unify user permissions
An active application ADMIN now passes every memo-local authorization
check on named operations: authorship, audience, Space membership and
participation, attachment and reaction ownership. Structural validity
still applies, an archived admin holds no privilege, and collection
listings keep the audience predicate so feeds never surface other users'
private memos.

- core/access: admin bypass in the read policy; CanManageMemo and
  CanManageAttachment as the shared author-level predicates.
- store: drivers read the actor's role alongside its lifecycle state in
  the mutation transaction; validators accept an admin where they
  required the author or a member; shared attachment binding and
  removal predicates.
- api: handlers use the shared predicates; admins may place memos in
  any existing Space and see a memo's Space by name.
- web: one canManageMemo helper replaces the ad hoc creator checks.
- docs: multi-spaces design revised in place; share RPC comments
  updated.
2026-09-17 23:28:19 +08:00
Johnny 289ca1ec3d fix(web): render tel: and sms: markdown links (#6341) 2026-09-17 23:01:09 +08:00
qwist1233-cpu f3bec7c735 chore(i18n): complete Turkish translations (#6339)
Co-authored-by: qwist1233-cpu <qwist1233-cpu@users.noreply.github.com>
2026-09-17 19:34:12 +08:00
bluedbird 471745b431 fix: harden attachment, auth, and import paths for public deployment
Bound work an anonymous or low-privilege caller can force:

- Bound thumbnail decoding by declared pixel count before decoding and
  remember images that cannot be thumbnailed (over the bound or not
  decodable), so a small image declaring billions of pixels is served
  as-is instead of decoded on every request. Transient storage read
  errors are not remembered. The bound lives in internal/imagelimit and
  is shared with EXIF stripping.
- Cap request bodies at 16 MiB for procedures that carry no file bytes;
  only inline attachment creation, transcription, and chunked uploads
  keep their larger caps.
- Digest over-long submitted usernames before using them as sign-in
  limiter keys, add header and idle timeouts to the HTTP server, limit
  filter expression size, and cap the SQLite regexp cache.

Close correctness gaps:

- Delete the thumbnail the file server actually writes (.v2.jpeg), its
  failure marker, and the legacy name when an attachment is removed.
- Decide EXIF stripping from the sniffed content as well as the declared
  type, so a mislabeled JPEG keeps no metadata.
- Revoke every other session when a password changes; an admin reset
  revokes all of the target's sessions. Prune expired refresh tokens.
- Enforce the 2 MiB avatar limit the web client already applies.
- Keep S3 object keys unique when the path template has no {uuid}.
- Reject negative attachment page tokens.
- Charge memo archive imports against the write and upload budgets,
  charge repeated validate-only plans, discard only attachments an
  import actually stored, and refuse archives that declare far more
  bytes than they hold.
- Load database-stored attachment bytes only after authorization.
- Remove the unused, unguarded linkmeta.GetImage fetcher.

Frontend: send no referrer when loading external images in memos and
link previews, and drop picture/source from the sanitizer so every
remote image goes through the https-only src rule.

Dependencies: grpc 1.83.1 and x/crypto 0.56.0 for reported advisories.
2026-09-17 08:47:44 +08:00
ABird 14d3c689dd feat(web): highlight search matches in memo content (#6335) 2026-09-16 23:48:00 +08:00
ABird 019ca26bd3 feat: export and import memos as a Memo Archive (#6334) 2026-09-16 22:23:38 +08:00
johnnyjoygh 305310cdd1 fix(map): clean up failed WebGL layers before leaving map 2026-09-16 08:51:41 +08:00
周耕毅(Ryan Chou) 143f224cdd fix(web): keep blurred memo header interactive (#6269) 2026-09-15 09:05:32 +08:00
ABird 2148bf7a21 fix(editor): expand tag autocomplete beyond heading markers (#6327) 2026-09-14 22:39:42 +08:00
ABird ba44a66911 feat: show attachment storage usage in account settings (#6326) 2026-09-14 21:49:48 +08:00
Anand Hegde a69d286735 fix(web): reveal metadata row controls on hover (#6324) 2026-09-14 19:46:50 +08:00
ocfox 49b7ecc583 fix(web): add dark mode theme-color meta tag for PWA status bar (#6320) 2026-09-14 19:43:32 +08:00
Johnny 2e33e7a561 fix(web): normalize memo header author spacing 2026-09-13 23:03:37 +08:00
ABird 45519accd3 refactor: name packages by role and enforce import direction (#6317) 2026-09-13 18:22:54 +08:00
boojack c506f67d22 feat(server): rate limit sign-in, signup, fetches, uploads, and writes (#6315) 2026-09-13 11:58:26 +08:00
boojack 751005bc19 feat(user): make email an optional, canonical, instance-unique attribute (#6314) 2026-09-12 12:21:41 +08:00
bluedbird 73306272f9 chore: tweak heatmap calendar cells
Calendar day cells drop the printed count and carry activity as a
GitHub-style background instead: four primary-tinted levels keyed to the
same all-time ceiling the sidebar heatmap uses, so a day reads alike in
both. Today and the open day share one 22px rounded badge on the
numeral,
primary for today and a quiet foreground wash for the open day, nested
in
a halo when both coincide. The cell type follows the sidebar row
grammar:
13px on 18px lines from the column axis, weight only for the open day,
and a strip of 36px photo marks under the excerpt.

The floating memo panel gets a popover surface and a new float shadow
token in every theme, and its resize trigger becomes a grip pill that
appears only while the pointer is over the edge strip.
2026-09-12 00:51:06 +08:00
boojack 98d8322f14 chore(web): polish the memo card and editor styles
The sidebar was recently tightened onto one grammar: 28px rows on a
shared
rail, two chrome type tokens (13px and 11px), quiet kit controls,
outline
focus, and accent fill reserved for the one thing that is on. The memo
card
and editor still mixed 32px and 24px controls, 12px and 14px chrome
type,
bordered "slab" sections, ring focus, and hand-rolled control looks.

Memo card
- The header is a fixed 24px row; time and creator are 13px, the creator
  collapses to one line with a 20px avatar.
- Attachments are part of the memo, not a labelled section: media
  renders as
  the bare gallery, and audio, files, relations and the location are one
  list
  of 28px rows whose glyphs sit on the memo's text edge and whose
  details sit
  on one trailing rail. A file row reveals its download arrow on hover;
  an
  audio row plays from its slot and opens a small player from its name.
- Relations carry their direction as trailing detail instead of a header
  and
  tabs. Reactions are pills, since they are tokens on the memo rather
  than
  controls; your own reaction and the add control take the accent while
  on.
- The comment strip is a titled row list with a View all action.

Memo editor
- Every toolbar control is 28px: quiet formatting segments with
  aria-pressed,
  an outline insert square matching the sidebar's compose control, a
  quiet
  visibility chip built like the scope pill, a quiet Cancel and a small
  Save.
- Attachment, relation and location rows share the metadata row grammar;
  their controls overlay the trailing edge on hover so the detail rail
  never
  moves. The tag autocomplete matches the small dropdown.

The row grammar lives in MetadataSection.tsx with its own helpers (icon
slot,
detail rail, remove control, list container) and stays deliberately
separate
from the sidebar's. Every Lucide glyph in these views draws at stroke
1.8, and
the last ring-based focus sites move to the outline constant.
2026-09-11 23:21:50 +08:00
johnnyjoygh 8701d93fc0 fix(editor): attach pasted files instead of inlining them
Pasting an image went through the inline-image path and wrote its
markdown
into the text immediately; the file only surfaced in the attachment list
once that markdown was deleted. A paste carries no placement gesture, so
pasted files now join the attachment list like the + menu's upload, and
the list's own Insert action is how a pasted image becomes inline. Drop
keeps inlining images at the drop point.

The CodeMirror handler reports the gesture as an EditorFileOrigin
through
the single onFiles callback, and MemoEditor owns one ingest function
with a
placement argument that the + menu, paste and drop all share.
createBlobUrl
is memoized so the ingest callback's dependencies hold.
2026-09-10 23:25:17 +08:00
Wally 98f9c215c4 fix(web): untrap focus mode in the memo grid and use a dark scrim token for overlays (#6310) 2026-09-10 09:31:05 +08:00
johnnyjoygh c218355b1b refactor(web): share one floating memo panel between calendar and map
The calendar's day panel and the map's location panel were two
implementations of the same surface: a resizable side panel that reads a
selection of memos as ordinary cards and ends with a quiet row that
becomes the editor in place. Fold both into components/MemoPanel.

MemoPanel is the map's floating, non-modal card generalized: a fixed
card at the end edge from md, a bottom sheet below it, with one
persisted
width shared by every host like the sidebar's. It owns the header, close
control, resize rail, internal scroll, busy lock and the exit-animation
snapshot. The width lives in a custom property on the document root so a
resize drag reflows the page beside the card live and commits once on
release; the panel measures its committed size for hosts that need
numbers. The rail stops short of the card's corners.

The calendar drops its docked aside and its modal mid-tier sheet for the
shared card. At xl the grid gives way to it so every column stays
legible; below xl it floats over the trailing columns; the phone tier
stays inline under the compact grid. The hand-rolled Escape listener
goes, since the dialog handles it.

MemoPanelList is the shared content block with the compose row keyed to
the selection, so a half-written memo never moves days or places.

Panel strings move to common keys; the calendar and map copies are
removed from every locale that carried them.
2026-09-10 09:30:40 +08:00
johnnyjoygh 88f150502c fix(sidebar): open the navigator label only where the row can afford it
The primary navigator gained a fifth square with the map page, which
left
the current page's label truncated at the default sidebar width. The
label
now opens through a container query on the row instead of eating
whatever
width is left: below a 230px row the current page stays a filled square
with its tooltip, and above it the whole word shows. Tighter gaps and
lead-
in make the default width the threshold.

Sidebar rows also adopt the kit's outline focus treatment in place of
the
last ring-based one.
2026-09-09 23:35:03 +08:00
johnnyjoygh bc89ec0006 feat(map): add a map page for located memos
Replace the profile's map tab with a /map route (also under Spaces) that
shows every located memo on a Positron vector basemap with clustering,
falling back to raster tiles when the vector style cannot load.

Selecting a pin or a cluster opens a side rail (a bottom sheet on
phones)
with the memos at that place; "Write here" expands into the editor in
place, seeded with the location. Selection and viewport live in the URL.

The sidebar's tag counts are scoped to located memos on this route, and
the editor draft cache now remembers a memo's location.
2026-09-09 23:04:06 +08:00
Johnny 51b434d3b5 feat(views): support custom icons for saved memo views (#6305) 2026-09-08 22:10:02 +08:00
boojack e02899e514 chore: move saved memo views into UserService 2026-09-08 21:40:50 +08:00
boojack b3e67399b8 feat(attachment): upload files in resumable chunks
Add UploadAttachment, a unary RPC that accepts a file in bounded chunks
and streams it to a temp file instead of holding the whole blob in one
request body and in memory. A call carrying a spec starts an upload and
returns an opaque upload_id; later calls carry that id with
write_offset,
data, and finish_write, following the Cloud Storage WriteObject shape.
Retrying the last chunk after a lost response is idempotent, uploads are
bound to their owner, and they expire after 30 minutes of inactivity.

CreateAttachment and the chunked finalize now share one processing
pipeline for motion-photo detection, EXIF stripping, and storage. The
motion-photo detector works over an io.ReaderAt so large JPEGs are never
loaded whole, and the request body cap is a single per-procedure lookup.

The web editor uploads through the new RPC in 2 MiB chunks with bounded
concurrency under the server's per-user limit.
2026-09-08 21:07:06 +08:00
ABird 34dbb83948 feat(spaces): support custom icons and emoji (#6287) 2026-09-07 23:12:18 +08:00
johnnyjoygh 92a95a262f chore(calendar): display daily snapshots with text and image previews 2026-09-07 21:44:59 +08:00
Johnny 2d75439ecc feat(memos): support moving memos between spaces (#6285) 2026-09-07 20:45:59 +08:00
johnnyjoygh 9da3765b19 refactor(web): drop the memo origin scope
The "all" / "preserve" origin scope existed to decide whether returning
from a memo detail should clear the remembered Space. With the Space now
part of the origin URL itself, nothing branches on it any more; it was only
computed, serialized into router state as fromScope, and threaded through
props as parentScope.

Router state is now just { from }, createMemoNavigationState takes one
argument, and resolveMemoDetailOrigin / resolveMemoParentPage return the
origin page as a string. The archived-memo fallback to /archived stays.
2026-09-07 09:33:47 +08:00
johnnyjoygh af008b2153 feat(web): scope Spaces by URL path instead of a remembered selection
The selected Space used to live in sessionStorage and ride along invisibly
with every collection route. It now lives in the URL: collection pages exist
both globally and beneath /spaces/:spaceUid, and the Space context derives
its scope from the current location.

- Add a Space route branch (Home, Explore, Calendar, Attachments) guarded by
  a SpaceRoute that shows loading, unavailable, and retry states.
- Resolve collection routes through one matchPath-based helper built from the
  route constants; build Space-scoped paths with buildCollectionPath.
- Fetch the route Space directly, seeded from the switcher list so pages are
  not held behind a second round-trip.
- Turn the Space switcher into plain links that preserve the current
  collection view and query.
- Drop the remembered-Space machinery: clearSelectedSpace/selectMemos,
  the compose-placement policy, routeSupportsCollectionScope, and the
  quick-find switchToAll flag are all implied by the URL now.
- Return from memo details to the full origin URL, including its Space.
- Add space.unavailable and space.back-to-memos strings; align the
  Azerbaijani catalog with English.
2026-09-07 09:29:50 +08:00
johnnyjoygh 0716eaac2c fix(editor): preserve memo timestamp edits when closing popover 2026-09-07 09:25:51 +08:00
Jamal Ali 3d97b39f2d feat(i18n): add Azerbaijani language support (#6278) 2026-09-06 22:52:59 +08:00
johnnyjoygh c031b77c83 chore: add a quiet button variant and one ring-free focus for kit
buttons

The calendar shipped its own "quiet control" grammar as a page-local set
of class strings: 28px tall, 13px text, muted ink that darkens under a
light hover wash, ring-free outline focus, and the accent fill reserved
for a pressed or current state. The same look was hand-rolled elsewhere
with drifting values (/65 ink, /50 washes, ring focus) as className
overrides on the kit's Button, against the kit policy.

The grammar now lives in the kit as `variant="quiet"`, with the accent
fill keyed off `aria-pressed`, `aria-current` and `data-popup-open`, so
a
control that is on, current, or holding a popup open fills itself. A
`size="icon-compact"` names the 28px square the sidebar already used for
its compose control; `sm` already had the height for labelled chips.

Kit buttons had no focus treatment of their own, so sites that needed
one
bolted `focus-visible:ring-*` overrides onto the Button. The base now
carries a 2px inset outline from a new `ui/focus.ts` constant that raw
controls (calendar grid cells, the reaction chip) import too, and the
calendar's controls.ts goes away.

With both in place the hand-rolled sites collapse onto the variant: the
calendar's header, month picker and day panel; the statistics month
navigator; the sidebar's section actions and compose and mobile menu
controls; the memo card's trailing actions and its action menu, which no
longer takes a className; the share-image dialog's footer; the memo
outline; and the inactive underline tab. The month title fills while its
picker is open and the outline's current heading fills like every other
current thing. Tests follow the classes they assert.
2026-09-06 22:43:21 +08:00
Johnny ad6433c51a feat(web): calendar day panel refinements (#6280) 2026-09-06 13:15:17 +08:00
Johnny 500bb716bc feat(web): add a calendar view of your memos (#6277) 2026-09-05 12:51:39 +08:00
johnnyjoygh 50e71e2192 chore(editor): name the commit action by host and surface its shortcut
The save button now reads Save in the composer, Update when editing, and
Comment in the comment editor, with a Cmd/Ctrl+Enter chip inside it that
is
hidden on coarse pointers. Saving keeps the verb and swaps the chip for
a
spinner in the same grid cell, so the button no longer changes width;
the
"Saving..." string is removed from every locale. Hosts that close after
saving hold a short "Saved" confirmation while the caches refresh, then
reset and close; the in-place composer clears immediately as before.
2026-09-05 10:19:22 +08:00
johnnyjoygh 5ad4aea565 chore(sidebar): move tag layout toggle into a menu 2026-09-05 10:17:19 +08:00
Johnny bf1f742321 feat(search): add expression mode to Quick Find (#6276) 2026-09-05 09:14:08 +08:00
Johnny 60b89736a2 feat(editor): autofocus Home on initial desktop load (#6275) 2026-09-05 07:43:20 +08:00
Ruben Pari f8b55ad16e fix(i18n): align Chinese sensitive content labels (#6274) 2026-09-05 07:21:35 +08:00
johnnyjoygh 55d8e6ad42 chore(web): compact user profile header and in-place views on profiles
The user page at /u/:username now opens with a compact identity block
(40px
avatar, name, handle, clamped bio) instead of a hero header with a share
button, and the list beneath it follows the user's column setting like
Explore does. In grid mode the header spans every column via a new
ColumnGrid
header slot, exposed through PagedMemoList.renderHeader. Loading shows a
skeleton after the standard delay, not-found renders a body instead of a
toast fired from render, and visitors get an explicit empty message.

Saved views now apply on profile routes too. A single profile-route
matcher
in lib/memo-views replaces five separate spellings,
isMemoCollectionRoute
names the routes where views, calendar days and tags narrow the list in
place, and the sidebar shows the Views section on every such route for
signed-in users. The never-taken navigation-target branch in the
collection
sidebar is removed along with its props.
2026-09-05 00:22:05 +08:00
Johnny dfa0fda766 feat(filter): support space placement in saved views (#6267) 2026-09-04 09:29:09 +08:00
Johnny 230e3a1d11 feat(spaces): deliver invitations to the inbox (#6266) 2026-09-04 08:58:49 +08:00
johnnyjoygh 1ed894bee4 chore(web): bump CodeMirror packages
Update @codemirror/view 6.43.6 -> 6.43.10, commands 6.10.4 -> 6.11.0,
state 6.7.1 -> 6.7.2, lang-markdown 6.5.0 -> 6.5.2 and @lezer/markdown
1.6.4 -> 1.7.2 to pick up upstream composition and Android/iOS fixes
while investigating #6183.
2026-09-03 23:43:38 +08:00
johnnyjoygh b88a71540a feat(web): add 0.5x and 0.75x audio playback speeds
Voice notes recorded quickly or in noisy surroundings are easier to
follow when slowed down. The speed button still starts at 1x and cycles
through 1.5x and 2x before wrapping to the slow rates.

Closes #6263
2026-09-03 21:34:38 +08:00