vectorcraft/crates
bflatastic 649656b092 Fix #369: restart the web build's graphics after a lost device or context
When the browser dropped the page's WebGPU device or WebGL context, the
editor kept running but nothing it drew reached the screen: Chrome and
WebKit showed a frozen, stale canvas and Firefox a blank page, while
edits and Save went on.

- ui-egui: new `graphics` module. `GraphicsLoss` carries a loss report
  from any thread (wgpu's device-lost callback, the canvas's
  `webglcontextlost` event) to the UI thread. `VectorcraftApp::
  graphics_lost` writes Data Recovery copies of the modified documents at
  once. The app now notices when the host hands it a new egui context and
  uploads everything again (fonts and theme, the canvas, place cursor
  thumbnails); every per-thread texture cache (layer, symbol, swatch,
  style, asset and glyph thumbnails, previews, font samples, Navigator,
  Flattener Preview) is a `TexCache` that empties for a new context.
  Without this, the moved app drew stale or wrong textures and egui
  panicked on its missing font families.
- web: the shell watches both loss signals; on a loss it puts a fresh
  canvas in place of the dead one and starts the same `WebRunner` again,
  handing over the same app (documents, undo, panels), with services made
  for the new context and a status-bar note. If no new graphics can be had
  (or after three losses) it removes the stale canvas, lets go of the
  recovery copies and says to reload.
- engine: `recovery::leave` lets go of a session's area but keeps its
  copies, so the reloaded page offers them at once instead of after the
  heartbeat goes stale.
- desktop: eframe can't give a window a new device, so a lost device
  (driver reset) is logged, the copies are written and the status bar says
  to save and restart; closing then skips the Save Changes question it
  can't show.
- Tests: loss reporting across threads, `TexCache` emptying, the app
  uploading the canvas, a cached preview, theme and fonts again in a new
  context (fails without the fix), copies written on loss, and
  `recovery::leave` offering copies at once with both lock and heartbeat
  stores. docs/development.md (web section) and ROADMAP updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 07:18:32 +07:00
..
brush M4.39: SVG symbols as <symbol>/<use>, hidden layers on Save, Dublin Core metadata 2026-10-05 09:03:52 +07:00
cad Fix #177: DXF Fit and Aligned text span their two points 2026-10-07 02:14:39 +07:00
color Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
doc Fix #381: round single corners with Direct Selection (per-corner Live Corners) 2026-10-08 06:56:32 +07:00
effects M8.14: Type and symbols in perspective are really projected and stay editable; attachments survive copies 2026-10-06 12:10:00 +07:00
engine Fix #369: restart the web build's graphics after a lost device or context 2026-10-08 07:18:32 +07:00
eps EPS import: type layout counts against the op budget, hostile executable-file tests (review of #331) 2026-10-08 05:24:44 +07:00
format Select: saved selections checked when a file opens, names capped, docs (review of #318) 2026-10-08 05:24:44 +07:00
geom Fix #381: round single corners with Direct Selection (per-corner Live Corners) 2026-10-08 06:56:32 +07:00
mcp MCP: panel names from the dock's own tables, object-read errors kept apart, docs (review of #328) 2026-10-08 05:24:44 +07:00
metafile M8.16: Envelopes bend images, symbols, gradients, patterns and appearance; warps keep their frame 2026-10-06 12:01:47 +07:00
pathops Fix #374: Shape Builder cuts regions with open paths and lines 2026-10-08 06:55:40 +07:00
pdf Part of #372: PDF/.ai import keeps strokes live and hidden and nested layers 2026-10-08 06:55:51 +07:00
plugins Fix #121: sandboxed WebAssembly plug-ins: object filters and live effects 2026-10-06 00:19:41 +07:00
render Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
svg Fix #381: round single corners with Direct Selection (per-corner Live Corners) 2026-10-08 06:56:32 +07:00
testkit M4.62: PDF/.ai layers from optional content: named layers with visibility, print state and lock; art that is off as hidden layers 2026-10-05 13:05:12 +07:00
text Type: Top-to-Top Leading follow-ups (review of #385) 2026-10-08 06:25:18 +07:00
tools Fix #381: round single corners with Direct Selection (per-corner Live Corners) 2026-10-08 06:56:32 +07:00
trace Robustness: VectorCraft never crashes — no panics in shipped code 2026-10-05 06:28:59 +07:00
ui-egui Fix #369: restart the web build's graphics after a lost device or context 2026-10-08 07:18:32 +07:00