Remove the unused `.github/actions/setup-sentry` action and its steps in
`release-mobile.yml` and `release-desktop.yml`.
Homebrew now rejects `getsentry/tools/sentry-cli` after its rename to
`sentry`. AFFiNE never calls global `sentry-cli`. Bundler plugins
resolve the locked binary from `node_modules/@sentry/cli-*`.
Co-authored-by: DarkSky <darksky2048@gmail.com>
Closes#16048
- Set `"reasoningEffort": "low"` on the 8 built-in one-click edit
prompts in `built-in.json` so default-thinking models (such as
`gemini-4-hydrogen`) avoid `high` thinking latency and cost on short
text edits, while keeping the 7 text-generation prompts on model
defaults.
- Upgrade `llm_adapter` to `0.4.2`, parse `reasoningEffort` inside Rust
`prompt_catalog.rs` (stripped from exported TypeScript prompt specs),
and apply `ReasoningConfig::default_only_effort` inside
`copilot/dispatch.rs` when explicit user reasoning is absent.
- Simplify `byok/probe.rs` to use
`ReasoningConfig::default_only_effort("minimal")` and align
`model_registry.rs` tests with the active `0.4.2` catalog.
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
Show a retry state in mobile storage settings when quota queries fail.
Clear native auth sessions and cookies after account deletion so the
next sign-in starts fresh. Use an adaptive card background for iOS
onboarding role cards in dark mode.
Co-authored-by: DarkSky <darksky2048@gmail.com>
Raise the BYOK probe `max_tokens` limit to `1024` for chat, tool
calling, and structured checks. Set minimal reasoning effort on
reasoning-enabled Gemini models so thinking tokens do not exhaust the
output budget.
Closes#16043
Co-authored-by: DarkSky <darksky2048@gmail.com>
Fall back from `narrow` to `short` in `i18nTime` when
`Intl.RelativeTimeFormat` outputs a leading minus or plus sign, fixing
negative relative times in French, Norwegian, Russian, and Swedish
without hard-coding locales.
Allow doc list date columns to expand from 60px to 96px so longer
localized relative times are not truncated.
Fixes#12753
Co-authored-by: kaventro <301901286+kaventro@users.noreply.github.com>
Fill all 439 missing Japanese translations in
`packages/frontend/i18n/src/resources/ja.json` while keeping key order
aligned with `en.json` and leaving existing translations unchanged.
Add missing `_few` and `_many` plural forms in `pl`, `ru`, and `uk` for
`com.affine.tags.count`, `com.affine.delete-tags.count`,
`com.affine.page.toolbar.selected`, `com.affine.tag.toolbar.selected`,
and `com.affine.collection.toolbar.selected`.
Fix stray `<b>` tags in Ukrainian
`com.affine.tag.toolbar.selected_other` and
`com.affine.tag.toolbar.selected_others`.
Split oversized embedding chunks to provider token limits and cap batch
tokens.
Treat provider 4xx input errors as terminal failures and cap repeated
index retries.
Filter ignored documents in sync, worker, retrieval, and progress paths.
Exclude inactive, skipped, failed, and ignored entries from backend
progress counts (#15979).
Closes#15978
Co-authored-by: DarkSky <darksky2048@gmail.com>
- Isolate worker realtime managers per server endpoint and route
frontend realtime calls through `ServerRealtimeService`.
- Show the joined workspace indicator only when `isOwner` is `false`.
- Use the mobile web sign-in panel when the target server differs from
the active native server.
Closes#16007Closes#14031
Co-authored-by: DarkSky <darksky2048@gmail.com>
Configure `ImageProxyService` in `AffineLinkPreviewExtension`, make its
URL reactive, and add `crossorigin="anonymous"` to image-proxy images.
Add an Electron `Referer` header for internal `assets://` worker
requests. Normalize custom-scheme and IP origins in
`worker.allowedOrigin`, and allow `x-affine-client-kind` in link-preview
CORS preflight responses.
Closes#14865
Co-authored-by: DarkSky <darksky2048@gmail.com>
Persist a refresh attempt ID before native token refresh requests on iOS
and Android, and send it in the `x-affine-refresh-attempt` header.
Retain rotated iOS token pairs across transient Keychain write failures,
and forward structured auth error codes from `AuthPlugin`.
Closes#15975
Co-authored-by: DarkSky <darksky2048@gmail.com>
Update broken release notes links in `CHANGELOG.md`, `README.md`, and
the app sidebar.
Point `CHANGELOG.md` to GitHub Releases and the new AFFiNE Blog release
notes tag page. Update `README.md` and `RootAppSidebar` to use
`https://affine.pro/blog/tag/release-note`.
Closes#15973
Co-authored-by: DarkSky <darksky2048@gmail.com>
Return empty overrides from ServerService.loadDbOverrides on Prisma
P2021 errors in script flavor.
Skip MonitorService cron work in script flavor. Pass abortOnError: false
to NestFactory.createApplicationContext. Call process.exit after runCli
completes so bootstrap failures exit promptly.
Co-authored-by: DarkSky <darksky2048@gmail.com>
Use Tooltip for non-diagnostic sync status in WorkspaceCard so hover
shows sync progress and clicks still open the workspace selector. Pass
withoutHover and tooltip to the diagnostic status Button to prevent
double hover backgrounds.
Co-authored-by: DarkSky <darksky2048@gmail.com>
Render mobile navigation doc rows with their local title when `canRead`
is undefined, showing the no-permission row only when `canRead` is
`false` to match the desktop sidebar and avoid permanent `Loading...`
states offline or on transient permission errors.
Co-authored-by: DarkSky <darksky2048@gmail.com>
On the US macOS layout Option+S produces `ß`. The guard from #14866
skips every Alt shortcut whose key is a non-ASCII character, so the
page/edgeless switch never fired there.
The event cannot tell a US user pressing Option+S for the shortcut from
a Polish user typing `ś` with the same keys, so this keys the guard on
the target instead: when the event targets an editable element (input,
textarea, contenteditable) the character is text input and the shortcut
is skipped, as in #14866; anywhere else there is nothing to type and the
shortcut runs.
Note: in page mode the doc root is contenteditable, so with the caret in
the doc Option+S still types `ß`; the shortcut works when focus is
outside text (edgeless canvas, header, sidebar). Fixing it inside text
would mean dropping #14866's protection or changing the binding.
fix#15232
Co-authored-by: DarkSky <darksky2048@gmail.com>
Pressing Tab in a table cell called `preventDefault` and did nothing
else, so the cursor stayed in the same cell.
Tab now moves to the next cell and Shift+Tab to the previous one. Both
wrap across rows and stop at the first and last cells.
fix#13915
Co-authored-by: DarkSky <darksky2048@gmail.com>
Closes#15763.
- Move `correctNumberedListsOrderToPrev` from `affine-block-list` to
`affine-shared/utils` (re-exported from
`@blocksuite/affine-block-list`).
- Call `correctNumberedListsOrderToPrev` in `indentBlock` and
`dedentBlock` so numbered list items and following siblings are
renumbered after indenting or dedenting in edgeless notes.
Co-authored-by: kaventro <301901286+kaventro@users.noreply.github.com>
Brings `ja.json` in line with `en.json` for the AFFiNE AI chat panel by
adding all 43 missing `com.affine.ai.*` Japanese translations (chat
panel tools, scopes, session deletion, and selected-source errors) and
updating `ja` in `i18n-completenesses.json` from 83 to 84.
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
**Blank Norwegian labels.** `nb-NO.json` had 168 keys with empty values
(for example `Publish`, `Link`, `Unpin`, `Disable Public Sharing`).
i18next returns an empty string for those instead of falling back, so
Norwegian users saw blank buttons and labels. This removes the empty
entries so they fall back to English, and updates `nb-NO` in
`i18n-completenesses.json` from 41 to 35.
**Stale SSRF error.** `error.SSRF_BLOCKED_ERROR` still said "Invalid
URL" in ar, de, fr, kk, ur, zh-Hans and zh-Hant. That text predates the
English message "URL blocked by SSRF protection: {{reason}}", so those
users never saw the reason. The current message is now translated in all
seven, including `{{reason}}`.
Closes#15954Closes#15937
- Reject legacy `space:join` requests with `UnsupportedClientVersion`
and disconnect the socket.
- Update `affine_merge` to `0.4.1` so markdown updates with repeated
characters succeed.
- Split model display names on whitespace or hyphens so GPT labels
highlight only `GPT`.
Co-authored-by: DarkSky <darksky2048@gmail.com>
Closes#15953
## What changed
- Set `options.max_matches` to `offset + size` in
`translate_search_request` when that sum exceeds 1000.
- Return `nextCursor` from `normalize` only when the page has hits and
the next offset stays below `total`.
- Enforce the 10000 pagination offset limit on offset-based cursors in
`query::compile` using the shared `parse_offset_cursor` helper.
- Keep non-offset cursors and background scan paths unchanged.
- Add table-driven unit tests for `max_matches` sizing, `nextCursor`
termination, and cursor offset bounds.
## Why
Manticore Search keeps 1000 matches per query by default. Requests past
that window return truncated pages or zero hits while reporting the full
`total`. Previously, `normalize` did not check for an empty page. An
empty page returned the same cursor and caused background sweeps to loop
on the same offset.
Raising `max_matches` also allows an external query with a large offset
cursor to request a large match buffer. Checking offset-based cursors in
`query::compile` blocks oversized user requests while keeping background
scans past 10000 rows working.
## Verification
- Model: Gemini 4 Neon
- Test frameworks: `cargo test` (`affine_server_native` search unit
suite, 36 passed), `rustfmt --check`, and a live pagination test against
`manticoresearch/manticore:29.0.2` with 1050 indexed rows.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Search pagination now handles empty and completed result pages more
reliably, avoiding misleading next-page links.
* Cursor offsets and page limits are checked more consistently,
including when values are unusually large.
* **Improvements**
* Searches that need to reach beyond the default result threshold can
now retrieve the requested page.
* Page limits above 10,000 are rejected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
The Persian (`fa`) value of `com.affine.calendar-date-picker.week-days`
was `ش,ی,د,س,چ,ج,ش`. It starts on Saturday (شنبه) and skips Thursday
(پنجشنبه). The date picker renders this string as a Sunday-first
header, so every Persian column was labelled with the wrong day:
| Column | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|---|
| Before | ش (Sat) | ی (Sun) | د (Mon) | س (Tue) | چ (Wed) | ج (Fri) | ش
(Sat) |
| After | ی | د | س | چ | پ | ج | ش |
The new value matches the CLDR narrow weekday names
(`Intl.DateTimeFormat('fa', { weekday: 'narrow' })`).
Tests: added `packages/frontend/i18n/src/__tests__/week-days.spec.ts`.
- Every supported locale has 7 week-day labels.
- Locales with single-character labels (`fa`, `ja`, `ko`) match `Intl`'s
narrow weekday names in Sunday-first order. The `fa` case fails on
current canary and passes with this change.
I checked the other non-Latin locales by hand (ar, kk, tr, ur, zh, ru,
uk, el-GR); they are already Sunday-first.
```
yarn vitest run packages/frontend/i18n/src/__tests__/week-days.spec.ts # 25 passed (fa fails without the fix)
yarn oxlint --deny-warnings packages/frontend/i18n/src/__tests__ # clean
yarn oxfmt --check <changed files> # clean
yarn tsc -b packages/frontend/i18n/tsconfig.json # no errors
```
## 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 (run on the changed
package)
- [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 PR was written with AI assistance and reviewed before submitting.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Corrected the weekday labels shown in the Persian calendar date
picker, providing a consistent sequence of day names.
* The updated labels help users identify weekdays more accurately when
selecting a date.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Adds Hungarian (`hu`) to the supported languages, with all 2,643 keys
translated.
Closes#15926
This replaces #15922, which I opened by mistake before the translation
was finished. Sorry for the noise.
**Changes** (three files, the same shape as the Turkish translation in
#15000):
- `resources/hu.json`: the new translation
- `resources/index.ts`: `hu` in `Language` and `SUPPORTED_LANGUAGES`
- `i18n-completenesses.json`: `hu` at 100
**How it was made and checked:**
- The translation was drafted by machine and revised with AI assistance.
I am a native Hungarian speaker and reviewed the result in the running
app.
- A script checked every key against `en.json`: placeholders, tags,
`$t()` references, line breaks and leading or trailing spaces all match.
- I built it on v0.27.4 and ran it on a self-hosted instance. In
Hungarian I went through the settings, sidebar, doc list, doc
properties, collections, tags, journals, trash, share menu and quick
search.
Some strings stay in English because they are hardcoded rather than in
`en.json`. They are not part of this PR.
## 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/)
- [ ] 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
* **New Features**
* Added Hungarian as a supported language, with translations across the
interface and a reported translation completeness of 100%.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Fixes#15617
After a middle-click pan in edgeless, the selected elements were
deselected.
`PanTool` saved the selection and restored it on pointer up, but it did
so **before** switching back to the previous tool.
`ToolController.setTool` clears the selection (`selection.set({
elements: [] })`), so the restore was always undone. The restore now
runs after `setTool`.
Scope: this covers the middle-mouse-button pan. Holding space to pan
(`edgeless-keyboard.ts`) already restores the selection after `setTool`,
so it is unchanged.
Tests: added a case to `pan-tool.unit.spec.ts` that checks the restore
runs after the tool switch. It fails on current canary and passes with
this change.
```
yarn vitest run --project=@blocksuite/affine-gfx-pointer # 8 passed (new test fails without the fix)
yarn oxlint --deny-warnings blocksuite/affine/gfx/pointer # clean
yarn oxfmt --check blocksuite/affine/gfx/pointer/src # clean
yarn tsc -b blocksuite/affine/gfx/pointer/tsconfig.json # no errors
```
## 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))
- [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 (run on the changed
package)
- [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 PR was written with AI assistance and reviewed before submitting.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
- **Bug Fixes**
- Restored the saved selection when temporary panning ends and the
previous tool is resumed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What
Brings `zh-Hans.json` in line with `en.json`.
| | before | after |
|---|---|---|
| keys | 2450 | **2608** |
| falling back to English | 158 | **0** |
Also refreshed ~25 entries that still held the English source string.
## Notes
- `{{placeholders}}` preserved verbatim; verified zero placeholder
mismatches across all changed strings.
- JSON only, no code changes.
- **If you sync this file from Crowdin**, just say so and I'll close
this in favour of the Crowdin round instead — I mostly wanted to flag
that Simplified Chinese is currently ~6% behind `en`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
- **Localization**
- Expanded Simplified Chinese translations for journal labels,
properties, menus, empty states, and the Intelligence workspace.
- Added translations for AI editor tools, BYOK provider and model
settings, mobile settings, and device management.
- Added localized messages for selected-source errors, billing and
purchases, document validation, invitation account mismatches,
authentication, sync, search, and real-time connection failures.
- Updated existing Chinese labels and descriptions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
The Markdown shortcut for creating code blocks currently accepts only
alphanumeric language identifiers. This prevents supported languages
such as `ts-tags` from being selected through the shortcut.
Updated the regular expression to accept hyphens in language identifiers
and added a regression test to verify code block creation with
TypeScript with Tags.
## Testing
Validated through GitHub Actions on my fork.
42 checks passed, 14 were skipped, and no checks failed. Lint, Typecheck
and BlockSuite test jobs passed.
[[View CI
results](https://github.com/ammarkaskar/AFFiNE/pull/1/checks)](https://github.com/ammarkaskar/AFFiNE/pull/1/checks)
## Checklist
- [x] I have signed the AFFiNE Contributor License Agreement.
- [x] The PR targets the `canary` branch and its title follows
Conventional Commits.
- [x] Tests are added or updated where it makes sense.
- [ ] `yarn lint` and `yarn typecheck` pass locally.
- [x] I have carefully reviewed the AI assisted code changes.
- [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**
* Code blocks now recognize language identifiers containing hyphens,
such as `ts-tags`.
* **Tests**
* Added coverage to verify that a hyphenated language identifier
displays the expected language label.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
This fixes translation strings that render as broken text. I found them
with a placeholder and markup check across all locale files, then
checked each one against how its key is rendered (`<Trans>` or plain
`t()`).
**Unclosed `<Trans>` tags.** For example, `<1>7 days<1>` should be `<1>7
days</1>`. Without the closing tag, `<Trans>` nests the second tag and
the rest of the sentence turns bold.
- Version history prompts
(`com.affine.history.confirm-restore-modal.{free,pro}-plan-prompt.description`):
en.json and the 17 locales copied from it. ca, ko and pl already had it
right.
- `recommendBrowser`: ca, es.
- `com.affine.payment.lifetime.caption-2`: ru, where `<a>…<a>` made the
link swallow the end of the sentence.
- `com.affine.payment.upgrade-success-page.support`: fr used `<3>`, but
only component `1` is passed, so the support email link was missing.
**Literal markup in plain `t()` strings.** These strings are rendered as
text, so the tags appear on screen.
- `<b>(</b>` in `com.affine.m.explorer.tag.manage-docs` (ar, it, pl, uk)
and in
`com.affine.m.selector.{info-total,title,info-added,info-removed}` (ar,
it, pl).
- `<b>` in `com.affine.payment.cloud.team-workspace.benefit.g1-3/g1-4`
(ja, zh-Hant) and in `Find 0 result` (sv-SE).
- `{AFFiNE}` in `com.affine.ai-onboarding.general.2.{title,description}`
(es).
**Wrong or missing variables.**
- ru `com.affine.payment.ai.billing-tip.end-at` used `{{due}}`, but the
code passes `end`, so the expiry date showed as a literal `{{due}}`.
- ru `com.affine.editor.at-menu.more-{docs,members}-hint` packed all
four plural forms into one string, so users saw "5 документа, 5
документов, 5 документов, 5 документа(ов)". They are now "Ещё
документов: {{count}}" and "Ещё участников: {{count}}", which read
correctly for any count, including `100+`.
- fr `com.affine.cmdk.affine.create-new-edgeless-as` dropped
`{{keyWord}}`. It now reads `Nouvelle page sans bords "{{keyWord}}"`, in
line with the existing French strings.
| Before (en, version history prompt) | After |
| --- | --- |
| …up to **7 days of version history.** | …up to **7 days** of version
history. |
I rendered the four `<Trans>` keys in every locale with react-i18next
15.5.1 and html-parse-stringify 3.0.1 (the versions in `yarn.lock`),
before and after the change, and all 26 locales now render correctly.
Only values change: key order and completeness are the same, and the
files keep their existing JSON format. The two doc comments in
`i18n.gen.ts` that quote the English history prompts are updated to
match.
Not included, left for a separate change: stale
`error.SSRF_BLOCKED_ERROR` translations that drop `{{reason}}`, and
style-only differences such as a missing highlight.
The fixes were drafted with AI assistance (Claude).
## 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/)
- [ ] Tests are added or updated where it makes sense (translation-only
change)
- [ ] `yarn lint` and `yarn typecheck` pass locally (not run: the change
touches JSON values and two comments only)
- [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**
* Corrected malformed rich-text markup in document-history prompts
across multiple languages, improving the display of plan details and
durations.
* Fixed several translation issues in browser recommendations,
onboarding, billing, editor hints, and tag-management labels.
* Cleaned up stray formatting in localized text.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15941** 👈
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**
* Document update tools now distinguish missing documents from other
failures and provide clearer error messages.
* Invalid legacy workspace snapshots are reported consistently, and
embedding sync retries those workspaces after a brief delay.
* **Chores**
* Updated a workspace dependency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
- add a fullscreen control to Mermaid previews
- use the browser Fullscreen API to enter and exit fullscreen
- add fullscreen-specific layout styles
- add E2E coverage for the fullscreen request
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added a fullscreen control to Mermaid diagram previews. Previews
expand to fill the screen with adjusted spacing and dimensions, and the
same control exits fullscreen. This gives diagrams more room to view
while keeping the preview’s fullscreen controls available.
* **Tests**
* Added end-to-end coverage verifying that the fullscreen control enters
and exits fullscreen mode for Mermaid previews.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
Resolves#15423
## Summary
Adds a per-doc read/edit toggle button to both the desktop and mobile
document headers, so a doc can be locked into a read-only view without
navigating away — primarily to avoid the mobile on-screen keyboard
popping up while scrolling.
## Relation to #15453
This replaces #15453, which was opened from a branch named
`fix/issue-15435` (an unrelated date-picker bug) and linked the wrong
issue (#15444, which is actually a previous closed PR, not an issue).
This PR carries forward all of that PR's code, rebased on latest
`canary`, plus fixes for the review feedback left on #15453:
- **Mobile toggle guard**: the mobile toggle button had no
`canEdit`/trash guard at all (desktop already had one) — both platforms
now hide/disable the toggle when the user can't edit or the doc is
trashed.
- **i18n**: added the missing
`com.affine.header.readonly-toggle.read-only` / `...editing` translation
keys (previously referenced keys that did not exist in `en.json`).
- **Styling**: removed redundant inline `style={{ marginRight: 8 }}` on
both header buttons — the surrounding containers already apply the
correct `gap`.
- **Analytics**: added a typed `toggleReadOnlyMode` event under
`track.$.header.actions`, following the existing `toggleFavorite: { on:
boolean }` convention.
- **Tests**: added `tests/affine-local/e2e/readonly-toggle.spec.ts`
covering toggle-on → body not editable → toggle off → editable again →
navigate to a new doc → no state leak.
## Known follow-up (not in this PR)
As raised in review, routing this through `doc.blockSuiteDoc.readonly`
(the same channel `DetailPageWrapper` already uses for trashed docs)
instead of local `isReadOnlyMode` state duplicated across desktop/mobile
would also fix the title editor staying editable while the body is
read-only. Keeping this PR scoped to the existing local-state approach;
open to a follow-up if the team wants the architecture change.
Interaction design (mobile-only vs. desktop+mobile, persisted vs.
ephemeral) is also still open for design feedback.
## Test plan
- [x] `tsc --noEmit` clean on all touched files
- [x] New e2e test covering the toggle/reset flow
- [ ] CI (build/typecheck/e2e workflows)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added a read-only/editing toggle to eligible document headers on
desktop and mobile. Its icon and label reflect the current mode.
* Read-only mode resets when you open a different document.
* **Bug Fixes**
* Prevented edits to document content, titles, and names while read-only
mode is enabled.
* Limited editing and the toggle to eligible documents. On mobile, the
toggle is unavailable in Edgeless mode when editing is disabled.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: donqu1xotevincent <vincent@toeverything.info>
Co-authored-by: DarkSky <darksky2048@gmail.com>
Table drag selection captured cell positions and the start point once,
in viewport coordinates. After the table or page scrolled, live pointer
coordinates were compared with those stale positions, so the selected
area no longer matched the pointer.
Cell positions are now read on each update, the drag anchor is stored
relative to the table, and the selection also updates on scroll while
the pointer rests.
fix#14416
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Table cell selections stay aligned with the pointer when the table
scrolls during a drag, including when the pointer remains stationary
after scrolling. Selected cells reflect the table’s current position
throughout the drag.
* **Tests**
* Added coverage verifying that drag selection spans the expected
columns after horizontal scrolling, both when the pointer moves again
and when it stays in place, ensuring consistent selection behavior in
both scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
## Description
The Block Diff Playground modal (the dev-only 🧪 button) was portaled
into `editor-host` via `container: this.host`. `editor-host` sets
`isolation: isolate`, so the modal's z-index only applies inside that
stacking context. Anything painted after the editor at the same level
ends up on top of the modal — in practice the backlinks panel's "Show"
button shows through right over the action buttons.
Removing the `container` option lets `createLitPortal` fall back to its
default (`document.body`), so the modal is no longer trapped under the
editor's stacking context. Positioning is unaffected since it's still
computed against the 🧪 button.
To reproduce: run the web app in dev mode, open a doc that's long enough
for the backlinks panel to sit behind the modal, click 🧪.
## 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/)
- [ ] Tests are added or updated where it makes sense
- [x] `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.
- [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
* **Refactor**
* Updated the playground portal to use its default container behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
`hi.json` translates 5 of the 2,622 current keys in `en.json`, so Hindi
is selectable in the language menu but almost every screen stays in
English. This PR adds 229 Hindi strings for the first-run path:
- `com.affine.auth.*` (sign in, sign up, magic link, password,
self-hosted server)
- `com.affine.rootAppSidebar.*` (favorites, organize, tags, collections)
- `com.affine.all-docs.*`, `com.affine.page.*` (doc list and display
options)
- `com.affine.workspace.*`, `com.affine.empty.*`,
`com.affine.toastMessage.*`
`i18n-completenesses.json` is updated with the same formula as
`build.ts` (`ceil(keys / en keys * 100)`): `hi` 1 -> 10. The formula
reproduces the committed `ur` value (90), which is how I checked it.
Every added string keeps the exact interpolation and tags of `en.json`
(`{{email}}`, `{{count}}`, `<1></1>`, `<a></a>`, `<b></b>`, `<0></0>`),
checked per key with a script that fails on any mismatch. Existing Hindi
entries are untouched; new keys are inserted in `en.json` order, so the
diff is additions only. Terminology matches the existing file
(कार्यक्षेत्र for workspace).
Same shape as the Urdu expansion in #14995.
Fixestoeverything/AFFiNE#14741
### Issue
When attempting to insert a table inside a nested numbered list using
the slash menu, the table would fail to insert and nothing would happen.
### Fix
- `insertTableBlockCommand` uses `addSiblingBlocks` which tries to add
the table as a child of the `affine:list` parent block — invalid for
a table block
- Added a walk up the parent chain while the parent flavour is
`affine:list`, so the table is inserted as a sibling of the outermost
list block instead
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
## Release Notes
* **Bug Fixes**
* Fixed table placement when inserting from a nested list item. Tables
now appear after the top-level list, while the list retains any
non-empty nested item.
* When inserting a table with empty-line removal enabled, the selected
empty line is removed instead of the insertion target.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
Mobile search rendered doc results with a plain `DocCard` linking to
`/<docId>`, dropping the `blockId` of the matched block from the search
payload. Opening a result therefore neither scrolled to nor highlighted
the match.
The search page now keeps the matched `blockId`, and `DocCard` takes
`blockIds` and links to `/<docId>?blockIds=<id>`. The mobile detail page
already binds the editor to the view's query string, so this is the same
path desktop quick search uses (`workbench.openDoc({ docId, blockIds
})`): the editor scrolls to and highlights the block.
fix#15153
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Mobile search results now open the matching document and navigate to
the specific section where the result was found, highlighting that
section when available.
* When a result has no matched section, selecting it opens the document
without a section-specific destination, preserving the existing
document-level navigation behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
Keydown events from the database search input bubbled to the editor's
document listener. With a cell selected, Backspace edited the search
text and also cleared that cell.
The search input now stops keydown propagation, so its keys only affect
the input.
fix#13796
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Pressing Escape in the data view search field no longer propagates the
keyboard event to document-level handlers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
Markdown, HTML and Word imports silently dropped a file when it could
not be read or converted: the per-file loop only kept files that
returned a doc id, and the file picker's snapshot step dropped
unreadable files with a `console.error`. The dialog then reported
"Import completed".
This change:
- moves snapshotting of picked files into the importer
(`snapshotReadableFiles`, already used by the Obsidian import), which
records unreadable files as warnings; the picker no longer has a
`snapshot` option
- records files the converter returned no doc for as `skipped_doc`
warnings
- shows "Import completed with warnings" and the list of warnings
instead of the success message when there are any
- sets `sourcePath` on Markdown zip docs so skipped entries are named by
path instead of a generated id
fix#15718
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Import status now reports when files are skipped, unreadable, or only
partially imported.
* Imported Markdown documents retain their source paths within the
archive.
* File and directory pickers can use the standard browser picker instead
of the File System Access API.
* **Bug Fixes**
* Importing multiple files now handles unreadable files and files that
cannot be converted without interrupting the remaining imports.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>
The desktop sign-in dialog set an inline `min-height: 550px`, which wins
over the modal's `calc(100dvh - 32px)` cap, and the dialog content had
no overflow, so in a window shorter than the dialog the controls below
the fold could not be reached.
This caps the min and max height at the viewport and lets the dialog
scroll. An e2e test opens the dialog in a 400px-high viewport and checks
that it fits and that its last button can be scrolled into view.
fix#15620
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* The sign-in dialog now adapts to shorter screens and scrolls when its
content exceeds the available space.
* **Tests**
* Added coverage to check that the login dialog and its final button
remain accessible in a short viewport.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <darksky2048@gmail.com>