The tray menu labels were hardcoded in English. They now come from i18n
keys, and the tray menu is rebuilt when the main process language
changes (the renderer already syncs its language to the main process).
Adds the Simplified Chinese translations.
A unit test builds the tray menu, switches the language to zh-Hans and
checks the labels.
fix#15684
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Desktop tray menu labels are now localized in English and Simplified
Chinese.
* Tray labels update when the app’s language changes, including
recording controls, settings, and app information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
Release builds of the Android app set `usesCleartextTraffic=false` and
`MIXED_CONTENT_NEVER_ALLOW` (#15118), so the app could not reach a
self-hosted server over http at all, including one on the local network.
This allows plain-text http/ws only to local network hosts, matching iOS
`NSAllowsLocalNetworking`:
- unqualified single-label names (`nas`, `localhost`) and `.local` names
- loopback, private and link-local IP literals: 127/8, 10/8, 172.16/12,
192.168/16, 169.254/16, `::1`, fc00::/7, fe80::/10
Anything else is refused, including public-looking names that resolve to
a private address (names are never resolved).
Android WebView cannot allow mixed content per host: the app runs at
`https://localhost`, so every http/ws request is mixed content,
`mixedContentMode` is WebView-wide, and WebView only honours the
app-wide cleartext flag. So cleartext and `MIXED_CONTENT_ALWAYS_ALLOW`
are enabled globally, and the rule is enforced in three places with the
same host check:
- `AffineWebViewClient.shouldInterceptRequest` answers plain http
requests to other hosts with a 403.
- The web app wraps `WebSocket` and `fetch` (main thread and the nbstore
worker), because WebView request interception never sees WebSocket
handshakes. This is where the sync `ws://` connection is refused.
- An OkHttp interceptor rejects plain http to other hosts for the native
clients (GraphQL, SSE, auth).
On Android and iOS, the add-server step rejects public `http://`
addresses with a message asking for an https address, a local IP or a
`.local` name.
The host check exists in TS (`@affine/core/utils/local-network`) and
Kotlin (`LocalNetwork.kt`); both are tested against the same table,
`core/src/utils/local-network/fixtures/hosts.json` (the Android unit
tests read it as a test resource). Other tests show public `http://` and
`ws://` are blocked in the web guard and in an OkHttp client, while LAN,
`.local` and https pass.
#15509 (server on a LAN IP) is fixed by this. The setup in #15438
(`http://affine.home.com`) stays blocked, as it is on iOS: that server
needs https, a local IP address or a `.local` name.
Tested: the TS tests with vitest, the Kotlin tests with JUnit outside
Gradle (Kotlin 2.2.20, JDK 21). Not run on a device or emulator; the
WebView and WebSocket behaviour is covered by unit tests only.
fix#15438fix#15509
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Android now allows HTTP connections to servers on the local network,
while blocking insecure connections to public servers. HTTPS connections
remain available.
* When adding a self-hosted server on Android or iOS, you’ll see
guidance if its public address uses HTTP. Use an HTTPS address or a
local network address instead.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
### Summary
Fixes#15818.
1.
**`blocksuite/affine/blocks/table/src/adapters/{utils,markdown,plain-text}.ts`**:
- Match `database/src/adapters/` and `table/src/adapters/html.ts` by
supporting plain-string cell values (`typeof v.value === 'string'`) and
missing/undefined `.text` in `processTable` (`utils.ts`),
`tableBlockMarkdownAdapterMatcher` (`markdown.ts`), and
`tableBlockPlainTextAdapterMatcher` (`plain-text.ts`).
- Previously, `table/src/adapters/markdown.ts` and `plain-text.ts`
unconditionally called `deltaConverter.deltaToAST(v.value.delta)`, which
threw `TypeError: Cannot read properties of undefined (reading 'map')`
when `cell.text` was a string or missing `.delta`, causing both `Export
-> Markdown` and `Export -> Copy as Markdown` (`copy-markdown`) to fail
inside `adapter.fromDoc(doc)`.
2.
**`packages/frontend/core/src/components/hooks/affine/use-export-page.ts`
&
`blocksuite/affine/widgets/linked-doc/src/transformers/{markdown,html}.ts`**:
- Propagate `Promise<boolean>` from `exportDoc`, `exportToHtml`,
`exportToMarkdown`, `HtmlTransformer.exportDoc`, and
`MarkdownTransformer.exportDoc` instead of hardcoding `return true` in
`exportHandler`.
- When `adapter.fromDoc(doc)` or `docToSnapshot(doc)` fails and returns
`undefined` (or produces empty output with no assets), `exportHandler`
now returns `false` so the user sees the error notification rather than
a false-positive `"Exported successfully / Please open the download
folder to check."` toast.
- In `copyAsMarkdown`, fall back to `new MarkdownAdapter(transformer,
doc.provider)` when `std` is not present (matching
`MarkdownTransformer.exportDoc`).
3. **`blocksuite/affine/widgets/linked-doc/src/transformers/utils.ts`**:
- Defer `element.remove()` and `URL.revokeObjectURL(fileURL)` in
`download()` via `setTimeout(..., 100)` (consistent with
`packages/frontend/admin/src/modules/accounts/utils/csv-utils.ts` and
`packages/frontend/core/src/blocksuite/database-block/properties/file/view.tsx`)
so the blob URL is not revoked synchronously before the download
initiates.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Table exports now handle missing or empty cell text consistently.
* HTML and Markdown export actions now report whether an export was
downloaded, and avoid reporting success when no export is available.
* Copying as Markdown works even when an editor standard scope is
unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
The code block's editable area inherited the browser's default
spellcheck, so identifiers and keywords were underlined as misspelled.
The code block now sets `spellcheck="false"` on its rich text. Other
text blocks are unchanged.
fix#13686
Co-authored-by: DarkSky <darksky2048@gmail.com>
- Update to DeletePermanentlyIcon in QuickDeletePermanently and
trash-page-footer
- A trivial refactor to use permanentlyDeletePage helper method
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Style**
* Updated permanent-delete buttons in quick actions and the trash page
to use a dedicated permanent-delete icon.
* **Bug Fixes**
* After confirming permanent deletion from the trash page, the app
returns to the All pages view and displays a confirmation once deletion
completes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
fix#13433
Saves the display preferences set on each collection view. So one
collection will open by default in Masonry view, while another will open
in List view. It works nearly identically to how the allDocs page saves
its display preferences, but makes a separate key-value pair for each
collection.
Works as intended right now, but with a bit of duplicate code from the
allDocs, i didn't want to touch that to avoid making too many
opinionated refactorings 😅
EDIT: added Playwright tests for the new functionality
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Collection pages remember list, grid, or masonry view modes and
display settings independently.
* Search results can include database rows linked to matching documents.
* AFFiNE AI offers Haiku and updated Claude and Gemini model options.
* Turkish translations have been updated and expanded.
* Self-hosted deployments support updated license options.
* **Bug Fixes**
* Document links and actions resolve consistently when a document has a
separate storage ID.
* Document deletion and sync are more reliable across devices.
* LaTeX editors support the platform’s select-all shortcut.
* **Tests**
* Added coverage for collection preferences persisting when collections
are reopened.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
The mobile keyboard toolbar's Callout action inserted the callout next
to `rootComponent.model`, the page root. The root has no parent, so the
action returned early and nothing was inserted.
It now inserts after the selected block, which it gets with
`getSelectedModelsCommand` like the other insert actions in the toolbar
(Table, Link, ...).
Adds an integration test that runs the toolbar's Callout item with the
cursor in a paragraph and checks that a callout with an empty paragraph
follows it.
fix#14523
Co-authored-by: DarkSky <darksky2048@gmail.com>
Notion exports person values as `<img class="icon user-icon">`. The
image matcher accepted every `img`, so each avatar was imported as a
full-size image block above the database or paragraph.
The matcher now skips images with the `user-icon` class. The person's
name is still imported.
fix#13703
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Notion user avatars in database person cells and paragraphs are no
longer imported as image blocks. Regular images and figures containing
images continue to be recognized during import.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Summary
- keep unused blob selection keyed across pagination
- make Select all include every unused blob, not only the current page
- delete selected blobs in bounded batches and retain failed items for
retry
- keep pagination valid after deletions and report partial failures
## Tests
- `yarn vitest run
packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/storage/blob-management.spec.tsx`
- `yarn oxfmt --check
packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/storage/blob-management.spec.tsx
packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/storage/blob-management.tsx
packages/frontend/i18n/src/i18n.gen.ts
packages/frontend/i18n/src/resources/en.json
packages/frontend/i18n/src/resources/zh-Hans.json
packages/frontend/i18n/src/resources/zh-Hant.json`
- `yarn oxlint --deny-warnings
packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/storage/blob-management.spec.tsx
packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/storage/blob-management.tsx
packages/frontend/i18n/src/i18n.gen.ts`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
- **New Features**
- Select unused blobs across pages, with selections retained for items
that remain available.
- Deletions refresh the blob list, skip items that are no longer unused,
and adjust pagination when the list shrinks.
- Failed deletions show a localized notification, and failed items
remain selected for retry.
- **Bug Fixes**
- Prevented selection changes while deletion is in progress.
- **Tests**
- Added coverage for multi-page selection and deletion, failed
deletions, and pagination updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
Closes#15468.
A doc linked with `@` inside a table block (`/table`, not a database
view) never appears in Bidirectional Links on either doc. The indexer's
`affine:table` branch in `@affine/reader` only collects cell text, so
the block document has no `refDocId`/`ref`, and the backlink query on
`refDocId` finds nothing. The `affine:database` branch already collects
inline references from rich-text cells.
This change reads the inline references from each `prop:cells.*.text`
value with the existing `getTextDeltasFromCellValue` and
`collectInlineReferences` helpers, and sets `refDocId` and `ref` on the
table block, the same way the database branch does.
Scope: this fixes the TypeScript crawler, which the web app (IndexedDB
storage) uses and which the desktop and mobile apps use as the fallback.
The native crawler in `affine_doc_loader` (`read/block.rs`,
`affine:table` branch) has the same gap, and this PR leaves it
unchanged.
Test: `should index references from table cells` in
`packages/common/reader/__tests__/reader.spec.ts` fails without the fix
(`expected undefined to deeply equal [ 'target-doc' ]`) and passes with
it.
## Checklist
- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [x] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [x] Tests are added or updated where it makes sense
- [x] `yarn lint` and `yarn typecheck` pass locally
- [x] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
- **Bug Fixes**
- Table cell text is now included when reading document blocks, and
references within cells are captured for indexing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
A heading with inline latex renders fine in the editor, but the outline
drops the formula. `Heading with $x^2$` shows up as "Heading with" in
the table of contents.
Inline latex keeps its source on `attributes.latex` and leaves the
insert blank, so `_TextBlockPreview` maps that delta to `nothing` and
the formula disappears. The outline now renders it with katex, the same
`renderToString` + `unsafeHTML` pair the latex tooltip already uses.
Verified on a local web build: before the change the outline showed
"Heading with formula", after it shows the rendered `x²`.
fix#15767
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Outline previews now display inline LaTeX as formatted mathematics
alongside surrounding text. Text without inline LaTeX keeps its existing
preview behavior.
* Search now includes documents referenced by database rows, with
results reflecting current document titles.
* Incomplete document creation can be recovered without creating
duplicate content.
* **Improvements**
* Logical document links now resolve more consistently across search,
comments, sharing, and document access.
* Document deletion and syncing now handle in-progress changes more
reliably.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: forestw1203 <329347558+forestw1203@users.noreply.github.com>
The date cell aria-label and data-date were built from Date#getMonth(),
which is 0-based, so 18 November was labelled 2026-10-18.
<!--
Thank you for contributing to AFFiNE!
The PR title must follow Conventional Commits (enforced by CI):
type(scope): description e.g. fix(editor): keep selection after paste
Types: feat fix docs style refactor perf test build ci chore revert
-->
## Description
<!-- What does this PR do? Link related issues, e.g. "Closes #1234".
Screenshots or recordings are welcome for UI changes. -->
## Checklist
- [ ] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [ ] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [ ] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally
- [ ] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [ ] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Corrected the month displayed in date-picker cell labels and date
attributes. Month values now follow the standard one-based format,
improving the accuracy of date information exposed to assistive
technologies and other consumers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
I noticed that clearing a number property in the doc info panel doesn't
really make it empty as far as collection rules are concerned.
`NumberValue` saves the trimmed input on blur, so a cleared field is
stored as `''`, and the three number providers in `collection-rules` all
pass the raw value through `Number()`, which turns `''` into `0`. The
result is that a doc whose number was cleared:
- matches the `= 0`, `< n`, `≤ n` filters (and `≥ 0`), even though
`is-empty` correctly reports it as empty;
- is sorted as if it held `0` by the number order-by instead of being
skipped like a doc that never had a value;
- ends up in the `0` group of the number group-by.
A doc that never had the property (value `undefined`) already behaves
correctly, since `Number(undefined)` is `NaN` and all three providers
drop `NaN`. The fix makes an empty string follow that same path (`value
? Number(value) : NaN`) in `filters/number.ts`, `order-by/number.ts` and
`group-by/number.ts`. A stored `'0'` is a non-empty string, so a real
zero is unaffected.
I added `collection-rules/__tests__/number.spec.ts`, which feeds the
providers four docs (`'0'`, `'3'`, `''`, `undefined`). On `canary` three
of its four tests fail:
```
AssertionError: expected [ 'cleared', 'zero' ] to deeply equal [ 'zero' ]
AssertionError: expected [ 'zero', 'cleared', 'three' ] to deeply equal [ 'zero', 'three' ]
AssertionError: expected { '0': [ 'zero', 'cleared' ], …(1) } to deeply equal { '0': [ 'zero' ], '3': [ 'three' ] }
Tests 3 failed | 1 passed (4)
```
With the change all four pass, and `yarn vitest run
packages/frontend/core/src/modules/collection-rules
packages/frontend/core/src/modules/journal` is green (25 tests).
`oxlint` and `oxfmt --check` are clean on the touched files.
## Checklist
- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [x] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [x] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally
- [x] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
Found by a defect-hunting pipeline I build and run
([Dev-next-gen](https://github.com/Dev-next-gen)), using Claude Code
with Anthropic's Claude Opus 5.
"Nothing this pipeline produces is submitted without human approval. The
entire pull request — the code change, the tests and this description —
was reviewed by a human before the pipeline was allowed to submit it."
(@Dev-next-gen)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
- **New Features**
- Search results can include database rows linked to matching documents,
with offset and cursor pagination.
- Linked-document references in database titles display resolved page
titles and remain searchable as titles change.
- AFFiNE AI adds Claude Haiku and updates available Claude and Gemini
models.
- Generated images can appear directly in AI responses when a shareable
link is unavailable.
- Select all in the LaTeX editor works with the platform’s standard
keyboard shortcut.
- **Bug Fixes**
- Cleared or unset numeric properties are no longer treated as `0` in
comparisons, sorting, or grouping.
- Linked document IDs resolve consistently across document actions and
views.
- **Tests**
- Added coverage for numeric filters, sorting, grouping, and emptiness
checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
In the mobile keyboard toolbar's highlight panel, the "Default Color"
items under Color and Background had no action, so tapping them did
nothing and a highlight could not be removed on mobile.
They now clear `color` / `background` (set it to `null`), the same as
the desktop highlight menu. The panel's formatting chain is shared by
all items instead of being repeated per group.
Adds an integration test that applies a red color/background through the
toolbar and checks that "Default Color" removes it.
fix#13745
Co-authored-by: DarkSky <darksky2048@gmail.com>
Inter ships as one variable font whose italics come from its `slnt` axis
(-10..0), but `fonts.css` only declared a face with the default
`font-style: normal`. For italic text Chromium up to at least 145 (and
so the current Electron 39 desktop builds) applied the slant axis and
then synthesized an oblique on top of it, which is why italics lean far
more than the font intends.
This declares an explicit italic face from the same file with
`font-variation-settings: 'slnt' -10`.
Rendered `font-style: italic` text, compared with upright text using
`font-variation-settings: 'slnt' -10`:
| | before | after |
|---|---|---|
| Chromium 145 / Electron 39 | slanted twice | matches slnt -10 |
| Chromium 150 (Electron 43) / Chrome 157 | matches slnt -10 | matches
slnt -10 |
| Firefox 160 | matches slnt -10 | matches slnt -10 |
| WebKit (macOS) | upright | upright |
Declaring the face as `font-style: oblique 0deg 10deg` instead fixes
WebKit but makes every Chromium version slant twice, so it is not used.
Without `font-variation-settings` on the italic face Firefox renders it
upright.
Adds a test that the italic face uses the font's own minimum `slnt`
value.
fix#14451
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
Disk Markdown sync could not reliably sync Markdown files written
outside AFFiNE:
- A file containing a table failed to import (`invalid_projection`),
because the table is an opaque block that the merge only accepts as a
block marker. Unchanged opaque blocks are now matched through the
checkpointed file body and passed to the merge as markers. Edits to an
opaque block are still rejected.
- Changes the Markdown source cannot carry, such as the collapsed state
the editor sets on blocks, produced a review candidate for a
hand-written file. They now leave the checkpointed file as it is.
- Frontmatter: an empty block (`---` followed by `---`) and a closing
delimiter at the end of the file were read as body text, YAML escapes
such as `é` were kept literally, and keys AFFiNE does not sync (for
example `aliases:`) were dropped on export. Unknown lines are now kept
verbatim.
- File names for non-ASCII titles fell back to `doc`.
- The temporary file used while creating a Markdown file had a `.md`
extension, so a leftover one was imported as a document.
## Verification
- `cargo test -p affine_native --lib disk_sync`
- `cargo clippy -p affine_native --all-targets --all-features -- -D
warnings`
- `rustfmt +nightly --check` on the changed files
The `i18n.changeLanguage` IPC handler returned the result of i18next's
`changeLanguage`, which is a translation function. A function cannot be
structured-cloned, so every call from the renderer rejected with
`DataCloneError` even though the language had changed in the main
process.
The handler now awaits the change and returns nothing. A unit test calls
the handler and checks the language changed and the result can be
cloned; on canary it fails with `DataCloneError: (...args) =>
this.t(...args) could not be cloned.`
Found by @keepClamDown in #15616.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Language changes continue to apply as requested, while the request no
longer returns an internal result.
* **Tests**
* Added coverage for changing the application language and restoring the
default language after testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
Embedding a video attachment in edgeless always gave it a fixed 4:3
bound, and the video filled it with `object-fit: cover`, so videos with
another aspect ratio were cropped.
The bound now takes the video's own aspect ratio when it is embedded,
the edgeless container scales its content uniformly from the bound
width, and the video uses `object-fit: contain` so it is never cropped.
fix#15563
Co-authored-by: DarkSky <darksky2048@gmail.com>
In a doc shown in center peek, clicking a comment mark or adding a
comment opened the comment tab of the workbench sidebar behind the peek
modal, so nothing visible happened.
This change:
- adds `PeekViewEntity.openInWorkbench(docRef, options)` (open the doc
in the workbench, close the peek) and uses it for the peek controls'
open / new tab / split view actions
- passes `isInPeekView` (from the existing `useInsidePeekView()`
context, as the edgeless block header already does) to the comment view
extension
- in peek view, the comment provider opens the doc through
`openInWorkbench` with `mode` and `commentId` before showing the comment
panel; the editor's existing `commentId` selector handling scrolls to
and highlights the comment
fix#15607
Co-authored-by: DarkSky <darksky2048@gmail.com>
Trashing a local workspace copies its directory to `deleted-workspaces`
and then removes the original. On Windows that removal often fails
because the database file is still locked; the error was only logged.
The leftover stays hidden while its backup exists, but deleting the
backup from the archive removed only the backup, so the next scan of
local workspaces found the leftover and the workspace came back.
- Removing a workspace directory now retries (`fs.rm` with
`maxRetries`), which covers a lock released shortly after the connection
is closed.
- Deleting a backup first removes the leftover original, then the
backup. If the leftover still cannot be removed, the error is returned
and the backup is kept, so the workspace stays in the archive (and
hidden from the workspace list) and can be deleted again later instead
of coming back. No data is removed unless the user deleted it.
Adds tests for deleting a backup with a leftover original, both when it
can be removed and when it is locked.
fix#14731
Co-authored-by: DarkSky <darksky2048@gmail.com>
Row order is locked while a table cell is being edited, but typing into
a selected cell wrote the first character before that lock applied. In a
sorted view the row moved immediately, while the selection kept pointing
at its old index, so typing was interrupted.
Typing now enters edit mode and locks the rows before writing the
character. The row re-sorts when editing ends, the same as when editing
starts with a double click.
fix#14043
Co-authored-by: DarkSky <darksky2048@gmail.com>
A connector endpoint dropped anywhere inside a frame snapped to the
frame's nearest anchor, so arrows inside a frame could not be placed
freely.
Frames now accept a connection only within 8px of their border.
Endpoints elsewhere inside a frame stay free, and shapes inside a frame
still receive connections.
fix#13876
Co-authored-by: DarkSky <darksky2048@gmail.com>
Editor popups are mounted inside `editor-host`, which forms its own
stacking context at the default level. The Show/Hide button in the
bi-directional links panel is positioned and rendered later, so it
painted over open database menus.
The editor container is a flex item, so it now sets `z-index: 1`. This
lifts the editor's stacking context above the following panels without
adding a positioned ancestor, so popup placement and click-outside areas
stay the same. The doc viewport uses `isolation: isolate` so the raised
layer stays below overlays outside the viewport, such as the outline
viewer in doc peek.
fix#14723
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Database view options menus now appear above overlapping controls,
making the menu easier to see and use.
* Editor popups are displayed above panels that overlap the editor.
* **Tests**
* Added coverage to verify the database options menu is visible and on
top at an overlapping point.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Summary
- Ignore `packages/backend/native/src/*.license.json` in
`.prettierignore` and `.oxlintrc.json` so signed license payloads stay
byte-stable.
- Format native Rust sources to `rustfmt.toml` and box
`VerifiedAnyLicense::V2` to keep enum size small.
- Set `claimed_attempt` on the claimed worker snapshot in
`snapshot_commit_is_atomic_and_transfer_moves_the_entitlement` to match
receipt generation fencing.
- Inject the `event` stub in `gateway-cluster.spec.ts` and add
table-driven checks for cross-channel `sync-027` invalidation
broadcasts.
## Production Lock-Release Race Fix
- `PaymentConnection::reacquire_with` previously dropped its
`close_on_drop()` connection and called `try_acquire` before Postgres
finished releasing session advisory locks.
- Under load, that race caused self-collision and spurious
`payment_busy` failures.
- `PaymentConnection::release` now runs `SELECT
pg_advisory_unlock_all()` and closes the connection before
`reacquire_with` or partial `try_acquire` failures return.
- `payment_session_locks_are_sorted_nonblocking_and_connection_bound`
now verifies 32 consecutive `reacquire_with` lock expansions without
collision.
## Verification
- `yarn lint:format` passed across 7504 files.
- `cargo +nightly fmt --all -- --check` passed.
- `cargo clippy --workspace --exclude affine_server_native --all-targets
--all-features -- -D warnings` passed.
- `cargo clippy -p affine_server_native --all-targets --all-features --
-D warnings` passed.
- `cargo test -p affine_server_native` passed for `license_v2`,
`receipt_attempt`,
`payment_session_locks_are_sorted_nonblocking_and_connection_bound`, and
`snapshot_commit_is_atomic_and_transfer_moves_the_entitlement` against
PostgreSQL 16 and Redis.
- `ava` passed both tests in
`packages/backend/server/src/__tests__/sync/gateway-cluster.spec.ts`.
Models: Gemini 4 Neon, Gemini 4 Carbon.
Test frameworks: Cargo test, Clippy, rustfmt, oxfmt, AVA.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved payment connection recovery so locks acquired before a failed
scope acquisition are released before retrying. Connections now release
their locks explicitly, and failures to unlock are reported as database
errors.
* Corrected gateway invalidation broadcasts so updates reach appropriate
remote channels without unnecessary broadcasts to local or unspecified
channels.
* **Tests**
* Expanded coverage for payment lock cleanup and gateway invalidation
routing, including cases with missing or local channel information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
Refs #15871
`get_mime` asks `infer` first, and `infer` returns `text/xml` for
anything that starts with `<?xml`. An SVG exported from draw.io,
Inkscape or Illustrator usually carries that declaration, so it was
labelled `text/xml`, while the same file without the declaration came
out as `image/svg+xml`.
`get_mime` now looks at the root element before calling `infer`. It
walks the first 64 KiB with `xmlparser` (already in the lock file
through `instant-xml`, now a direct dependency), skipping BOM,
whitespace, comments, processing instructions and DOCTYPE with an
internal subset, and stops at the first element name. A root of `svg` or
`prefix:svg` gives `image/svg+xml`. No DTD is fetched and no entity is
expanded.
`file-format` matches `<svg` as a bare prefix or substring, so
`<svg-image/>` or `<svgFoo>` used to come out as SVG. When the scan
finds a root with a different name, the result is now `text/xml`. When
the scan is inconclusive (truncated root tag, root beyond 64 KiB,
invalid UTF-8), the old result is kept.
Scope, to be precise about what this changes on canary: the normal image
upload path (`setBlob`, presigned and multipart) stores the MIME type
the client sends and never sniffs, so a correctly typed upload does not
hit this. What does hit it is every path that relies on server-side
detection: object storage writes without a content type
(`complete_for_body`), comment attachments (`getMime`), and the
`sniffMime` callers (copilot attachments, workspace files, transcripts,
conversation inbox, avatars). Blobs already stored as `text/xml` are not
migrated.
Security: `applyAttachHeaders` already treats both `text/xml` and
`image/svg+xml` as dangerous inline types (forced `attachment`
disposition plus `nosniff`), so download handling does not change.
Avatars and inbox images still go through `processImage`, which rejects
SVG just as before.
Tests:
- `cargo test -p affine_server_native file_type::tests`: declaration,
BOM, comments, DOCTYPE with entities, `xml-stylesheet` PI, `svg:svg`, a
long Illustrator-style header; non-SVG roots, `<svg>` inside comments,
entities and children, `<SVG>`, `<svg-image>`; truncated and empty
input; the 64 KiB bound.
- `cargo test -p affine_server_native
runtime::object_storage::fs::tests`: put without a content type, then
HEAD/GET, for bare SVG, declaration SVG and plain XML; explicit
`image/svg+xml` and `text/xml` are kept as given.
- `cargo clippy -p affine_server_native --lib` is clean.
## Checklist
- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE)
- [x] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [x] Tests are added or updated where it makes sense
- [x] `yarn lint` and `yarn typecheck` pass locally (Rust-only change;
`cargo clippy` and `cargo fmt --check` on the touched files)
- [x] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
#### PR Dependency Tree
* **PR #15885** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved handling of app links and shared content when the iOS app
opens or returns to the foreground.
* iOS simulator tests now install and launch the app before running, and
verify that it stays open.
* **Chores**
* Updated the iOS build and release process to use Xcode 27 and require
an iOS SDK version of 27 or later.
* Adjusted release builds to preserve the required components for iOS
app packaging.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15867
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Workspace manifests now reference only the current avatar, including
when the workspace document is incomplete. Stale avatars and unrelated
image references are no longer treated as accessible through the
manifest.
* Generated images can be returned inline when a signed link is
unavailable, avoiding unnecessary failures in that case. Image results
and remotely fetched images are also stored consistently.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15883** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Document creation can now recover incomplete registrations without
recreating document content.
* Document updates can detect revision conflicts, helping prevent
changes from overwriting newer edits.
* **Improvements**
* Document sync and update handling are improved across desktop,
Android, and iOS.
* Workspace metadata and legacy document pages are handled more
consistently during migration and recovery.
* Creator and editor details are better preserved when documents are
recovered or compacted.
* **Configuration**
* Removed the experimental document-merge setting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixes#15643
## Problem
In Firefox, pressing Ctrl+A in the LaTeX editor popup (inline equation
or equation block) selects the formula for a moment, then the selection
disappears. After that, typing has no effect. Chromium works.
Two things go wrong on Firefox:
1. **The select-all is dropped.** Firefox places the native select-all
range on the inline root rather than on text nodes. The editor's range
sync (`RangeBinding._onNativeSelectionChanged`) removes ranges whose
endpoints aren't inside a `v-text`. Table and database cells already
handle `Mod+A` themselves with `inlineEditor.selectAll()`, but the popup
didn't.
2. **Input over a full selection goes to the end.** Even with a proper
selection, Firefox's `beforeinput` `getTargetRanges()` starts at the
inline root (for example `DIV[data-v-root]@2`, just before the
`v-line`). That point resolves to the end of the text.
`EventService._onBeforeInput` then lets the target range replace the
native one, so `a+b=c` + `x` became `a+b=cx` instead of `x`, and
Backspace did nothing.
## Fix
- `LatexEditorMenu` handles `Mod+A` with `inlineEditor.selectAll()` and
stops the event, the same way `table-cell.ts` and the database cell
renderers do.
- `EventService._onBeforeInput` uses the target range only when the
native selection is collapsed. A non-collapsed selection is exactly what
the input replaces. Target ranges are still used for collapsed
selections, e.g. word deletion and the embed/empty-line case above it.
## Testing
- New unit test in `event-beforeinput.unit.spec.ts`. It selects the
whole text and feeds a Firefox-shaped target range that starts at the
inline root.
- Without the `event.ts` change it fails with `expected 'a+b=cx' to be
'x'`, the same result as in Firefox.
- With the change it passes.
- `yarn vitest run` in `blocksuite/framework/std`: 12 files, 102 tests
pass.
- `oxlint --deny-warnings` and `oxfmt --check` pass on the changed
files, and `tsc -b blocksuite/affine/inlines/latex/tsconfig.json`
passes.
- I couldn't run a patched build in Firefox. Instead I checked both
changes in Firefox and Chromium (Playwright, headless) on
app.affine.pro, using a guest doc and injecting equivalent handlers into
the page. With both changes, Ctrl+A in the inline equation editor keeps
`a+b=c` selected, typing `x` gives `x`, and Backspace clears it. Without
them, Firefox shows the bug described in the issue.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Select-all now works in the LaTeX editor with the platform’s standard
keyboard shortcut.
* Fixed text replacement after selecting all, including cases where the
browser reports the selection from the start of the editor.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Complete the Turkish catalog with all 288 entries missing from the
current English resources, covering AI tools, sync/storage warnings,
BYOK, MCP credentials, device sessions and server errors. Correct 55
existing translations, including the missing SSRF `{{reason}}`, reversed
frame-link wording, the omitted snapshot export action, and inconsistent
Edgeless/seat/token terminology. Preserve BlockSuite as a product name
and update Turkish completeness from 90 to 100.
### Validation
- All 2,622 English keys have Turkish translations; four existing legacy
keys are preserved.
- Interpolation variables and rich-text tags match English for every
source key.
- All source keys resolve and interpolate with i18next 25.0.0; SSRF
reasons, MCP validity dates and AI action counts were exercised.
- JSON parsing, duplicate-key checks, `oxfmt` 0.63.0 on both changed
files and `git diff --check` pass.
- Follow-up validation used Node 22.23.4 and Yarn 4.18.0. Full `yarn
install --immutable` fetched 2,620 packages but failed during linking
with ENOSPC on the 7.9 GB workspace. A focused `yarn workspaces focus
@affine/i18n` installation succeeded.
- Full lint remains blocked by missing root ESLint plugins
(`eslint-plugin-import-x`) in the focused installation. Package
TypeScript checking was attempted with the installed TypeScript compiler
and reports missing `affine__env` definitions. These checks are not
claimed as passing. No full application build was run.
Prepared with OpenAI Codex; translations and diff reviewed against the
English catalog.
## Checklist
- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — CLA status to
be verified by the repository check.
- [x] The PR targets `canary` and its title follows Conventional
Commits.
- [x] Tests are added or updated where it makes sense — locale
validation and runtime checks performed as described above; no
application code changed.
- [ ] `yarn lint` and `yarn typecheck` pass locally — blocked by
incomplete monorepo dependencies as described above.
- [x] AI-generated edits have been carefully reviewed for scope and
correctness.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Localization**
* Expanded Turkish translations across AI chat, search, synchronization,
account, workspace, subscription, and import experiences.
* Added localized messages for provider and model settings, credentials,
device sessions, connection issues, and empty explorer views.
* Updated terminology and clarified several error messages.
* Turkish translation coverage is now complete.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15850
#### PR Dependency Tree
* **PR #15865** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Search results now include database rows that reference matching
documents, showing the referenced document’s current title.
* Linked-document titles appear consistently in database title and
rich-text values, including after a title changes.
* Search includes ordinary text matches alongside linked-document
references and supports retrieving additional results.
* **Bug Fixes**
* Rows referencing unavailable documents are not presented as
linked-title matches.
* If linked-row lookup fails, ordinary document search results remain
available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15863** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* The notification menu item no longer displays an active state solely
because the notification list is open; opening and closing the list
works as before.
* **Style**
* Refined the layout of the workspace sync-status button while
preserving its existing label and appearance details. The status content
now has more consistent spacing and alignment within the workspace card.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15854** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added workspace document lifecycle tracking, including trashed and
deleted states, with migration support.
* Added workspace inventory syncing and state refresh across cloud and
local storage, improving document discovery and offline synchronization.
* Added clearer messages for invalid or oversized document updates and
temporarily unavailable sync or validation.
* Added paused-upload diagnostics and a Quick Export shortcut for
relevant workspace sync issues.
* **Improvements**
* Search, indexing, and document metadata now reflect workspace
inventory and lifecycle state.
* Restoring from history preserves concurrent edits made during
recovery.
* Unused-blob checks now scan document content and detect changes during
scanning.
* **Bug Fixes**
* Invalid document updates are rejected without partially saving a
batch.
* Document reading handles missing or cyclic block relationships more
reliably.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15820** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved image handling in AI conversations: supported images are
resized and sent as WebP, with transparency preserved.
* Image attachments that can’t be loaded or encoded now report an error
instead of being silently omitted.
* Invalid image uploads now receive clearer error messages, while
unrelated processing errors retain their original details.
* Copilot message errors now surface more directly, while missing or
inaccessible sessions continue to be reported as unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15817** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added managed Copilot model routing with route choices and defaults
based on available configuration.
* Expanded model routing support to include OpenRouter and additional
request formats.
* Route options are now available for self-hosted deployments when
configured targets support them.
* **Bug Fixes**
* Added clearer errors when a selected Copilot target is unavailable.
* Improved configuration migration behavior to preserve custom model
profiles and legacy credentials.
* Cloud deployments now receive a clear configuration error when
attempting to set Copilot provider profiles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15482
#### PR Dependency Tree
* **PR #15811** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved CalDAV account setup across server configurations, including
servers that redirect discovery requests or use relative calendar links.
* CalDAV connection errors for unauthorized or forbidden access are now
surfaced without attempting fallback requests.
* Calendar and event retrieval continues to work across supported
discovery scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What
Mounts a `DirectionProvider` in `AffineContext` that feeds the current
language's text direction to all Radix UI primitives. Adds an `rtl` flag
to `LanguageInfo` (from `SUPPORTED_LANGUAGES`), with a colocated unit
test.
Part of #8966.
## Why
Radix primitives read direction from React context, not from the
document `dir` attribute. Since #14624, `document.documentElement.dir`
correctly flips to `rtl` for Arabic/Persian/Urdu — but every Radix
dropdown, popover and menu still hard-renders LTR internally.
## Notes for reviewers
- `@radix-ui/react-direction` is pinned to the exact version the other
Radix primitives resolve (`1.1.1`), not a caret range. A caret range
resolves to a newer duplicate module copy, which means a different React
context object — the primitives would silently ignore the provider.
Verified at runtime both ways.
- Portaled Radix content preserves React context, so portaled popovers
inherit direction too.
## Testing
- `yarn typecheck`, `yarn vitest run
packages/frontend/core/src/modules/i18n` (3 tests) pass.
- Verified in the running web app (Playwright + manual): with language
set to العربية, the workspace selector popover and menus render
`dir="rtl"`; English UI unaffected.
fix#15746
#### PR Dependency Tree
* **PR #15809** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Database cells with values that don’t match their property type now
display the property’s default value instead of appearing empty or
undefined. Valid values continue to display as before, and the stored
cell value is not changed. This provides a more consistent display for
affected cells while preserving existing behavior for valid data.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Allows columns and tags with empty or whitespace names to remain visible
and clickable in Kanban and Table views.
- Display fallback `"Untitled"` label and placeholder when tag name is
empty or whitespace.
- Set minimum height on `SelectGroupView` tag pill to prevent height
collapse.
- Add unit test verifying fallback rendering.
<img width="519" height="633" alt="image"
src="https://github.com/user-attachments/assets/1fed7a72-5154-4dcb-a5f8-a7c6f6ac132f"
/>
Closes#15805
## Description
`generateFractionalIndexingKeyBetween(a, b)` can return a key that sorts
after `b`.
When the subkeys of `a` and `b` share a prefix, the key is built as
`generateKeyBetween(a, b) + '0' + postfix()`. If `b` itself starts with
`generateKeyBetween(a, b) + '0'`, the order against `b` is decided by
the random postfix. For example, with `a =
Zz0KDAn9nhfbtFAOnyTqT45wXkV4SGW7XBh` and `b =
Zz10c5IY1TbnCK75NE22mfQEp2rpu6q1n6Z7`, `generateKeyBetween(a, b)` is
`Zz1` and the returned key was `Zz10UESACG9CHEXJNxgEDqhyCILR7N91EmcV`,
which is greater than `b`.
This is easy to reach from the UI helpers: `FolderNode.indexAt('after',
firstId)`, the favorites list, pinned collections, workspace properties
and table rows/columns all call it with their neighbours and sort with a
plain string compare. Starting from an empty list, adding one item
before the first and then repeatedly inserting right after the first
item breaks the order in 1000 out of 1000 runs within 20 inserts; the
inserted item ends up after its intended next neighbour.
The fix keeps stepping towards `b` with `generateKeyBetween(key, b)`
while `b` still starts with `key + '0'`, so the appended postfix can no
longer push the key past `b`. Each step lengthens the shared prefix with
`b`, so the loop ends. Both copies of the helper (`@toeverything/infra`
and `@blocksuite/affine-shared`) get the same change.
Proof: the added tests in `fractional-indexing.spec.ts` and
`fractional-indexing.unit.spec.ts` insert right after the first key 50
times, 100 rounds each. Before the fix both fail (`key < b` is false);
after, both pass across 5 reruns. I also fuzzed 1500 sequences of 200
inserts with mixed insertion strategies: 677 ordering violations before,
0 after, no throws.
## Description
Closes#14098
When a numbered list doesn't start at 1 (for example it picks up at 3
after a paragraph or a code block), AFFiNE keeps that number in the list
block's `order` prop. Importing markdown/html already reads the list's
start number into `order`, but the markdown and html exporters never
wrote it back, so the exported list always restarted at 1.
This sets `start` on the exported markdown list / `<ol>` from the first
item's `order` when it's above 1. Lists that start at 1, or older blocks
without `order`, export exactly as before. I added a test for each
exporter; the markdown one is the reverse of the existing "non
consecutive numbered list" import test. PDF export already used `order`,
so it wasn't affected.
## Description
`@next sa` gives me Next Sunday, same with `@last sa`. Saturday never
shows up.
The week loop returns the first alias that fuzzy-matches, and
`nextsunday` is checked before `nextsaturday`. Since `fuzzyMatch`
accepts any subsequence, `nextsa` finds an `s` and then an `a` inside
"sunday" and stops there.
Now it ranks the candidates instead of short-circuiting. A contiguous
run beats a scattered subsequence, and month names compete on the same
score, so `@no` reaches November instead of Next Monday. Ties keep the
old order, so `@ns` still gives Next Sunday and `@nxtus` still gives
Next Tuesday.
Tests in `suggest-date.spec.ts`. The saturday cases and the november
case fail on canary without the change.
fix#15745
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Journal date suggestions now rank fuzzy matches, favoring prefixes
over contiguous and subsequence matches.
* Month matches can take precedence over weaker weekday matches. When
suggestions tie, the earlier candidate is retained; for the tested
query, this selects next Sunday.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15576
#### PR Dependency Tree
* **PR #15803** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved reliability of real-time subscriptions during disconnects,
reconnects, context changes, and concurrent requests.
* Subscription updates are now routed to the matching topic and input,
and canceled subscriptions are handled without disrupting other active
subscriptions.
* User-profile requests can resume after a disconnect and reconnect.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->