Commit Graph
3400 Commits
Author SHA1 Message Date
Sidharth VinodandClaude Fable 5 b3c8bd6c28 refactor: Migrate editor state from svelte/store to runes
Replace the writable+derived store pipeline in state.ts with a
state.svelte.ts module: a deep $state inputState mutated only through
the exported update functions, each of which persists the snapshot and
re-validates it asynchronously into validatedState.current (with
urls.current derived from it). Store subscriptions in components become
$effect blocks, and the rough/grid toggles use function bindings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 00:34:07 +05:30
Sidharth VinodandClaude Fable 5 ca96ca8771 feat: Add shared runes-based localStorage persistence module
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 00:23:48 +05:30
Sidharth VinodandGitHub 219d8af74f Merge pull request #1984 from mermaid-js/sidv/fixViewURL
fix: base URL handling
2026-06-09 19:40:49 +05:30
Sidharth Vinod 49c5928202 fix: Resolve URLs in urlsStore 2026-06-09 19:32:08 +05:30
Sidharth VinodandGitHub 459c22cf09 Merge pull request #1982 from mermaid-js/sidv/rewrite-timeline-history
fix: Rewrite Timeline/Saved history state and UI handling
2026-06-08 15:01:44 +00:00
Sidharth VinodandClaude Opus 4.8 f25b3c82cd refactor: De-duplicate mode routing and drop dead getStateString
Code-review cleanup:
- Collapse the two mode switches (the historyState.entries getter and
  activeSlot) into a single slotFor(mode) helper; entries now reads
  `slotFor(mode)?.value ?? loader`.
- Remove the now-unused getStateString export from state.ts (its only
  consumer was rewritten off it in this PR).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 20:28:50 +05:30
Sidharth VinodandClaude Opus 4.8 2db9355b7b fix: Accept time:0 entries and precompute history entry URLs
Code-review follow-ups:
- validateEntry no longer rejects entries whose time is 0 (epoch); it now
  checks `typeof time === 'number'`, so restoring/uploading such entries
  works instead of silently dropping them.
- History.svelte serializes each entry's "open in new tab" URL once via a
  $derived list instead of calling serializeState (pako deflate) per row on
  every render.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 20:22:40 +05:30
Sidharth VinodandClaude Opus 4.8 8dd9cb49a0 feat: Add "open in new tab" link to history entries
Each history entry now has a third action: a real anchor (rendered via
the Button's href, target="_blank") linking to the editor with that
entry's serialized state. Being a normal link, users can also copy it or
open it in a new tab via the context menu.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 20:03:31 +05:30
Sidharth VinodandClaude Opus 4.8 64e8822e32 fix: Make svelte-check pass and resolve TS6/Svelte 5.56 type errors
Adding the `svelte-check` CI gate surfaced pre-existing type errors and
warnings under develop's TypeScript 6 / Svelte 5.56 bump. Fixes them so
`pnpm check` reports 0 errors / 0 warnings:

- Add `lang="ts"` to Share/Privacy (and a script to PrivacyPolicyLink) so
  importers get real declarations instead of implicit `any`.
- Replace the deprecated `monaco.languages.json` with the new top-level
  `monaco.json` namespace (proper API, no casts).
- Navbar: use `resolve('/', {})` instead of the deprecated `base`.
- Type the promo `component` as `Component<{ closeBanner: Snippet }>` and
  MainMenu's `renderer` as `Snippet<[Omit<MenuItem, 'renderer'>]>`.
- Index-by-string casts in state.ts / Preset / DiagramDocumentationButton.
- Make Actions' clipboard handler accept an optional event.
- toggle-group: expose variant/size via getters to fix the
  state_referenced_locally warning.
- Make the History e2e save/delete cases change state via a sample
  diagram (deterministic) instead of editor typing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:53:25 +05:30
Sidharth Vinod a3a3f8ffbe Update .gitignore 2026-06-08 19:28:39 +05:30
Sidharth VinodandClaude Opus 4.8 e6333e9d7f refactor: Convert history state to Svelte 5 runes + add svelte-check
Migrate the Timeline/Saved history state module to idiomatic Svelte 5
runes and wire up type-checking.

- Rename history.ts -> historyState.svelte.ts and replace the Svelte
  stores with $state-backed reactive values, removing the get() calls
  (the only remaining one reads the external inputStateStore). A small
  localStorage-backed `persisted()` helper keeps the same keys, so user
  data is preserved. Consumers read via the reactive `historyState`
  getter object instead of store auto-subscriptions.
- The gist loader now replaces the in-memory revisions in one call
  (setLoaderEntries) instead of appending, so loading a new gist no
  longer accumulates stale revisions.
- Add svelte-check: new `check` script, a "Type check" step in the
  unit-tests CI workflow, and skipLibCheck so the check passes on the
  dependency .d.ts files. svelte-check reports 0 errors / 0 warnings.
- Add accessible labels to the History toggle and the per-item
  Restore/Delete buttons (a11y + testability).
- Unskip tests/history.spec.ts and rewrite it against the new UI:
  load-from-localStorage + restore, tab-highlight follows the mode,
  save/dedupe, auto-vs-manual isolation, and delete/clear. All pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:28:38 +05:30
Sidharth VinodandClaude Opus 4.8 3628acec02 fix: Rewrite Timeline/Saved history state and UI handling
The auto (Timeline) and manual (Saved) history handling had several bugs.
This rewrites the state module into a small, tested source-of-truth API and
turns History.svelte into a thin view.

Bugs fixed:
- Auto-saves no longer leak into the Saved list. addEntry now writes only to
  the store for its own type (previously every entry was also pushed to the
  manual store).
- Dedup is keyed on code + config via stateKey() instead of the whole input
  state, so volatile/view-only fields (renderCount, updateDiagram, pan/zoom)
  no longer cause spurious saves or hide real edits.
- The active-tab highlight tracks the history mode. History binds
  activeTabID={$historyModeStore} and Tabs derives the highlight reactively
  instead of mutating its prop once, which had frozen it on the first tab.
- Auto-save runs for the whole edit session via startAutoSave() in +page,
  with proper cleanup. Previously the interval lived in History.svelte, only
  ran while the panel was open, and was never cleared (leaking a new interval
  on every open).
- restoreEntries() routes each uploaded entry to the store matching its own
  type instead of dumping everything into one store by the first entry's type.

The persisted localStorage keys (autoHistoryStore, manualHistoryStore,
autoHistoryMode) are unchanged, so existing user data is preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:27:23 +05:30
Sidharth VinodandGitHub ebced635c9 Merge pull request #1774 from mermaid-js/sidv/fixUndo
fix: #1753 Undo in Monaco
2026-06-08 13:16:56 +00:00
Sidharth VinodandCursor 1f0812496e fix: prevent state feedback loop when updating Monaco via executeEdits
Guard programmatic editor updates so sample diagrams and URL loads do not re-trigger onUpdate, which caused infinite state/URL churn and failing e2e tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 18:40:07 +05:30
Sidharth Vinod c62ebf6d09 fix: #1753 Undo in Monaco 2026-06-08 18:14:56 +05:30
Sidharth VinodandGitHub 6438d0074d Merge pull request #1719 from mermaid-js/renovate/all-minor-patch
chore(deps): update all non-major dependencies to v10.34.1
2026-06-08 18:02:54 +05:30
Sidharth VinodandGitHub 130711a9d0 Merge pull request #1718 from mermaid-js/renovate/patch-all-minor-patch
chore(deps): update all non-major dependencies to ^24.12.4
2026-06-08 18:02:07 +05:30
renovate[bot]andGitHub 7c6e28e163 chore(deps): update all non-major dependencies to v10.34.1 2026-06-08 12:27:57 +00:00
renovate[bot]andGitHub 1b432bcaaa chore(deps): update all non-major dependencies to ^24.12.4 2026-06-08 12:27:15 +00:00
Sidharth VinodandGitHub da89994440 Merge pull request #1980 from mermaid-js/chore/update-all-deps
chore: update all dependencies to latest versions
2026-06-08 12:21:54 +00:00
Sidharth VinodandCursor c25675d418 chore: update all dependencies to latest versions
Bump the full dependency tree (Vite 8, Vitest 4, ESLint 10, Svelte 5.56,
mode-watcher 1.x, etc.) and adapt code for breaking API changes. Upgrade
Playwright CI image to v1.60 for Node 24 compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 17:47:38 +05:30
Sidharth VinodandGitHub a58cde9516 Merge pull request #1971 from mermaid-js/chore/node-24-lts
chore: Node.js 24 LTS and latest mermaid packages
2026-06-08 11:41:55 +00:00
Sidharth VinodandCursor ccf5a13018 fix: upgrade Playwright to 1.60 for Node 24.16 compatibility
Playwright <1.60 hangs on browser extraction under Node 24.16.0; bump
the test dependency and CI container image to unblock e2e.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 17:08:27 +05:30
Sidharth VinodandGitHub 4ab4e022a0 Merge branch 'develop' into chore/node-24-lts 2026-06-08 16:19:46 +05:30
Sidharth VinodandGitHub 52abdccc3a Merge pull request #1963 from IvanTheGeek/bug/1961_favicon-link-tags
fix(#1961): Correct favicon link tags
2026-06-08 08:22:51 +00:00
Ivan The Geek d134306482 fix: drop ico link tag — favicon.ico has opaque white corners
The .ico file is a single 32×32 frame with white (255,255,255,255)
pixels filling the rounded-corner regions instead of transparent
ones, so declaring it as an `<link rel="icon">` made Chrome render
the favicon with visible white corners on dark backgrounds. The
svg+xml type fix and apple-touch-icon link remain — those don't
involve the .ico.

Legacy browsers that need the .ico will still find it via the root
`/favicon.ico` auto-probe; regenerating the .ico from favicon.svg
so its content matches the rest is a separate asset change.
2026-06-07 13:34:40 -04:00
Sidharth VinodandCursor d040d8d84a chore: bump mermaid and related packages to latest
Upgrade mermaid 11.15.0, layout-elk 0.2.1, and layout-tidy-tree 0.2.2.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 01:07:52 +05:30
Sidharth VinodandCursor c2cd0c0bfc chore: upgrade Node.js to 24.16.0 LTS
Pin CI, Docker, and engines to the current Active LTS and bump @types/node.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 20:44:47 +05:30
Sidharth VinodandGitHub 2ff56f67bc Merge pull request #1965 from mermaid-js/sidv/editor-chooser-live-2026
Ship editor chooser testB with live_2026 UTM campaign
2026-05-29 16:02:47 +05:30
Sidharth VinodandCursor 55d9bd043f refactor: Inline editor chooser modal content
Remove the separate testB component now that the A/B test is over.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 15:49:44 +05:30
Sidharth VinodandCursor adf3ddf015 feat: Ship editor chooser testB and use live_2026 UTM campaign
End the A/B test by always showing the testB modal, remove unused variant
components and assignment logic, and route CTA links with utm_campaign=live_2026.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 15:45:04 +05:30
Sidharth VinodandGitHub bfea7dd4db Merge pull request #1964 from mermaid-js/sidv/close-broken-link-issues
chore: Auto-close issues with only "Broken link" in title
2026-05-28 00:42:19 +05:30
Sidharth VinodandCursor 7cd24ddcb3 chore: Clarify live editor vs Mermaid syntax issues in auto-close comment
Direct syntax error reports to mermaid-js/mermaid and limit this repo to live editor bugs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 00:41:27 +05:30
Sidharth VinodandCursor 241f99bacf chore: Auto-close issues with only "Broken link" in title
Add a GitHub Action that closes low-effort issues using the default pre-filled title and prompts reporters to include the failing URL and details.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 00:38:52 +05:30
Ivan The GeekandIvan The Geek 472a3283c8 fix(#1961): Correct favicon link tags
Three small markup fixes in src/app.html:

- Update the icon link's `type` from `image/png` to `image/svg+xml` so
  it matches its `favicon.svg` href. The MIME mismatch was introduced
  in #1065 when the href was switched from `.png` to `.svg` without
  updating `type`; browsers ignore the attribute and trust the
  Content-Type so it rendered fine, but the markup was incorrect.
- Add an explicit `image/x-icon` link for `favicon.ico`. The file
  already ships in `static/`, but it was previously discoverable only
  via the root `/favicon.ico` auto-probe.
- Add an `apple-touch-icon` link pointing at `favicon.png` (512×512)
  so iOS "Add to Home Screen" uses the Mermaid logo instead of a
  low-quality page screenshot.

No behavior change for existing desktop users.
2026-05-25 13:38:32 -04:00
Sidharth VinodandGitHub 7b43e33971 Merge pull request #1951 from ZenUml/chore/mermaid-zenuml-0.2.3
[codex] bump mermaid-zenuml to 0.2.3
2026-05-18 20:17:21 +05:30
MrCoder 6af70cb44c chore: bump mermaid-zenuml to 0.2.3 2026-05-14 16:56:18 +10:00
Sidharth Vinod 1fabea49cf chore: Update mermaid-examples 2026-04-23 14:40:49 +05:30
Sidharth VinodandGitHub 1bd6355ea8 Merge pull request #1938 from mermaid-js/sidv/editorChooserExperiments
feat(MC-4486): Add variations to editor picker
2026-04-23 14:32:44 +05:30
Sidharth VinodandGitHub 29eb7b01fc Merge pull request #1939 from mermaid-js/sidv/EnhancedEditButton
chore(MC-4489): Add enhanced edit button
2026-04-23 14:16:34 +05:30
Sidharth Vinod b446c37315 chore: Add enhanced edit button 2026-04-23 13:31:19 +05:30
Sidharth Vinod 031477cda9 fix: Update tagline and layout 2026-04-23 13:05:45 +05:30
Sidharth Vinod a9becf5509 fix: copy 2026-04-22 22:37:01 +05:30
Sidharth Vinod 79c4b3bf55 chore: Add noopener 2026-04-22 21:04:00 +05:30
Sidharth Vinod a61a69e477 fix: Show picker on netlify 2026-04-22 18:58:31 +05:30
Sidharth Vinod 1daac45c87 feat(MC-4486): Add variations to editor picker 2026-04-22 18:52:02 +05:30
Alois KlinkandGitHub e3562168ad Merge pull request #1929 from mermaid-js/renovate/mermaid-packages
fix(deps): update dependency mermaid to ^11.14.0
2026-04-10 12:42:42 +00:00
renovate[bot]andGitHub 7fa7a48325 fix(deps): update dependency mermaid to ^11.14.0 2026-04-10 12:39:46 +00:00
Alois KlinkandGitHub 4925de94a9 Merge commit from fork
fix: improve sanitization of mermaid config
2026-04-10 21:35:24 +09:00
Sidharth Vinod 679e444bf1 chore: Remove canonical 2026-04-02 17:34:24 +05:30