The docs vitest config aliases the bare package name to src/index.ts as a
string prefix, so the new /browser entry point resolved to index.ts/browser
and every suite importing src/shared/ipc.ts failed to load.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The number-stored-as-text cell renders correctly, so the Univer popup title should read Warning, not Error. Share the copy between the en-US boot locale and the runtime language switcher so one cannot regress. Fixes#236.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(ai-provider): allow keyless custom endpoints for local models
* fix(ai-provider): use fresh response for second header assertion
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
- Docs: Word-style dark page, phased fast open for long documents, fonts embedded in the DOCX, spellcheck toggle, hyperlink editing, and ~80 Word fidelity fixes (CJK/JP metrics, header/footer, tables, anchored pictures)
- Sheets: hold formula recalculation while file data streams in, large-workbook scroll/load performance, combo charts, duplicate/unique conditional formatting by display text, RTL frozen-pane fix, workbooks whose ZIP entries carry a leading slash
- Slides: MTX-compressed embedded font support, CJK/Latin face selection and PowerPoint script fallbacks, theme colors kept on paragraph defaults and bullets, more reliable AI edits with a layout audit after each batch
- PDF: AI page ops, text block move/align, notes and markup editing, watermark and header/footer, form check boxes, metadata; the cloud Export as Word fallback is removed, conversion is always on-device
- AI: Gemini tool schema translation, OpenCode Zen/Go providers, markdown tables and code blocks in chat, current date in the system prompt
- Shell: Office-style ribbon collapse across all editors, native Windows ARM64 installer, BUILD_DIR override for packaging
Co-authored-by: GenOffice <merrick-2002@users.noreply.github.com>
* fix(ai-panels): clear restored history transcript on New chat (fixes#195)
* ci: retrigger checks after prosemirror teardown flake
* fix(docs): drop staged attachments on New chat
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Co-authored-by: merrick-2002 <merrick@mainfunc.ai>
* test(slides): cover agent run lifecycle persistence
* test(slides): preserve good images when one attachment read fails
* fix(slides): preserve agent runs across lifecycle boundaries
* style(slides): format agent lifecycle test
* docs(contributing): document TAVILY_API_KEY in env var table
* ci: retrigger checks after flaky unhandled error in docs test job
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(ai-provider): omit deprecated temperature on Gemini 3.6/3.7/3.5-lite
* style: wrap long geminiTurn call for prettier
* fix(ai-provider): keep default temperature for Gemini 3 family
Google strongly recommends the default temperature (1.0) for Gemini 3 since lower values may cause looping or degraded reasoning. Match the whole gemini-3 family instead of specific ids.
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(slides): serialize concurrent saves to prevent file corruption
The save() function had no in-flight guard: double-tap Ctrl+S, a user-initiated save during the 30s autosave, or a close-save during autosave all issued overlapping slides:save IPC calls. The main-process handler writes via createWriteStream directly to the target path — two concurrent writes interleave zip streams, truncate the pptx, or fail with EPERM/EBUSY on Windows, then both completions race on the dirty flags. Queue saves behind a promise-chain tail (the same pattern as the docs save serializer and PR #149's markdown fix) so only one write runs at a time.
* fix(slides): mock UI-only imports in save-serialization test (fix canvas in CI)
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(ai-provider): sanitize Gemini tool schemas for union types and refs (fixes#186)
Gemini FunctionDeclarations use a restricted Schema where type must be
a single string (not an array) and items a single Schema, and $ref/definitions
are not understood. Docs insert_chart/edit_chart use type ['number','null']
and ['string','null'] for nullable values, which caused HTTP 400:
Unknown name "type" at '...value.items': Proto field is not repeating,
cannot start list.
because the proto's type field is not repeated.
- Add sanitizeGeminiSchema() that resolves $ref (paragraphs), collapses
union types to single type + nullable: true, ensures items is single
schema (tuple -> first), and strips definitions.
- Use it in geminiTurn via toGeminiParameters() so every tool's
inputSchema is Gemini-compatible.
Fixes#186
* style: fix formatting for gemini sanitize helper
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
The layout audit flagged ALL vertical-text bodies (vert/eaVert/wordArtVert) as width overflow because it compared pre-rotation run.x/widthPx against innerW. The renderer keeps horizontal layout convention in the lines, so run.x/widthPx describe the pre-rotation advance — comparing them against innerW false-positives on every vertical box. Skip the width check when vert is set (height check via contentHeight still applies). Adds regression test.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Every app's AI IPC handler computed `request.maxTokens ?? 8192`, and no
renderer ever sends maxTokens — so the per-turn output budget was a
hardcoded 8192 that BYOK users could not change. For a reasoning model
that cap is shared with thinking: probed against api.deepseek.com/v1 with
max_tokens=3000, usage came back completion_tokens=3000 /
reasoning_tokens=3000 with zero content deltas and finish_reason=length,
i.e. the model never started answering. At the observed ~129 tok/s the
8192 default is exactly the ~60s "empty reply" users reported.
Thinking cannot simply be switched off for these models: registry.ts pins
the *direct* deepseek endpoint to non-thinking because its transcript
could not round-trip reasoning, while modelEchoesReasoning() documents
that DeepSeek V4 rejects tool turns unless the reasoning is echoed back.
So the honest lever is the budget, not the switch.
- AiSettings.maxOutputTokens (absent = default, so existing settings
files keep behaving identically), clamped to [1024, 131072] when read
and when typed: a hand-edited or mistyped value can never be forwarded
to an endpoint verbatim.
- docs/sheets/slides main handlers resolve the cap through
maxOutputTokensOf(settings); markdown and pdf share docs' ai:stream
channel, so all six apps follow the setting from one place.
- Settings ▸ AI model: a numeric field (clamped on blur) labelled in all
19 languages.
- sheets' aiSettingsInputSchema is .strict(), so it had to learn the key
or saving settings would have started failing.
A BYOK reasoning model can spend the whole output budget on thinking and
close the turn with finish_reason=length and no prose at all. The loop
already reports that as `truncated`, and docs appends aiTruncatedNote to
the bubble, but markdown and pdf destructure only
{text, cancelled, turnLimit} — so the run rendered the bare "(no reply)"
(while an empty "(no reply)" turn also made the following turns look like
the assistant had stopped listening).
Probe against api.deepseek.com/v1 (max_tokens=50/3000, thinking on by
default): completion_tokens == reasoning_tokens, content deltas never
start, finish_reason=length — reasoning tokens are billed against
max_tokens, at ~129 tok/s (≈ the agent default cap of 8192 in 60s).
Both panels now take `truncated` and append the note exactly like docs;
aiTruncatedNote is added to all 19 locales of both apps, copied from
apps/docs/src/renderer/i18n/ai/*.ts so the wording stays uniform.
- Docs: DOCX rendering and pagination fidelity (page borders, VML pictures, header/footer images, cross-page tables, anchored floats, character-unit indents, CJK typography)
- Docs: more reliable PDF export for huge documents; AI rewrites keep the replaced content's formatting
- Sheets: merge workbooks; Excel-standard keyboard shortcuts; PDF export with header/footer variants and pictures
- Sheets: rendering, conditional formatting, chart and formula fidelity fixes; right-to-left sheet support
- Slides: WordArt text warp, improved text layout and font substitution; AI table edits keep formatting
Co-authored-by: GenOffice <merrick-2002@users.noreply.github.com>
* fix docs canvas losing per-section left page margins
The editor pads .doc-page by the FIRST section's margins (--page-pad) and
only ever gave later sections their own wrap width, never their own x
offset. A document whose opening section is full-bleed (w:pgMar
w:left="0", typical for a cover page) therefore lost the 30mm left margin
on every following page: body blocks kept the correct width but were
glued to the paper edge, leaving a dead band on the right.
sectionWidthSpecs now emits a real dx (the block's section marginLeft
minus the canvas inset). It rides the existing visual-translate channel,
composes with column/vAlign offsets, and is neutralized while measuring,
so page slicing is untouched. Gap header/footer strips follow their own
section inset (--gap-ml on the gap box) instead of being pinned to the
first section's column; table gaps keep the canvas target.
Vertical margins were already per-page (the gap bands carry each
section's top/bottom), which is why only the horizontal offset leaked.
* fix docs pct-width tables spanning the whole paper
w:tblW type="pct" (and AutoFit to Window, which parses as 100%) is a share
of the section's TEXT COLUMN. Both rendered a bare width:100%, which
resolves against the canvas' padding box — and that box is padded by the
FIRST section's margins. A document opening with a full-bleed cover
section (w:pgMar w:left="0") therefore laid every later table across the
whole paper, hanging past the right edge as soon as the body sections'
own left inset was applied.
Both paths now resolve through the per-block --doc-content-w that
sectionWidthSpecs already delivers (unset → the old percentage, so
single-section documents are byte-identical). Protected tables get the
same treatment; nested tables keep their cell-relative % since they
inherit the outer table's --doc-content-w.