Skip to content

feat(mind map): offer the downward layout in the direction bar - #10940

Merged
eliandoran merged 1 commit into
mainfrom
claude/theme-management-review-yet2z7
Aug 8, 2026
Merged

feat(mind map): offer the downward layout in the direction bar#10940
eliandoran merged 1 commit into
mainfrom
claude/theme-management-review-yet2z7

Conversation

@eliandoran

Copy link
Copy Markdown
Contributor

Mind Elixir 5.15 added a fourth way to lay a map out — the root at the top with its branches hanging below (direction: 3, initDown()) — but left it out of its own toolbar, so nothing in Trilium offered it. The direction bar carries it now, beside the three it already had.

Stacked on #10901

This targets renovate/mind-elixir-5.x rather than main, because initDown() does not exist in 5.14 — it needs that bump to land first. GitHub retargets this to main automatically once #10901 merges. Merge #10901 first.

Note that the renovate branch has moved to 5.15.1 since that PR was opened (its title still says 5.15.0).

What changed

  • MapToolbar.tsx — a fourth entry in buildDirections(): value: 3mind.initDown(). Nothing else needed changing; useMapDirection already just reads mind.direction, which 5.15 widened to 0 | 1 | 2 | 3 on its own.
  • direction-down.svg — a new mask. Mind Elixir ships no icon for this layout (its own toolbar still builds only tbltl/tbltr/tblts), so this is the rightward glyph under rotate(90 512 512) — a downward layout is the rightward one turned a quarter turn. Reusing the path keeps the set visually consistent and the existing MIT attribution (© 2019 DjZhou) intact.
  • MapToolbar.css — the mask rule for the new mark.
  • en/translation.jsonmind-map.direction-down, "Branches downwards".
  • MapToolbar.spec.tsx — the mock gains initDown, and the three direction tests now assert four buttons plus a press/active check for the new one.

Verification

The four glyphs were rendered in headless Chromium to confirm the rotation reads correctly — root on top, two children hanging below, matching the weight and style of the other three.

The unit tests were not run locally: pnpm install could not complete in the authoring environment (the lockfile fetches electron/node-gyp from codeload.github.com, which was blocked there). The spec changes are mechanical, but they rest on CI rather than on a local green run.

Follow-up not included here

docs/User Guide/User Guide/Note Types/Mind Map.md:21 still describes the direction buttons as "(to the left, to the right, or to both sides)" and needs a fourth option. That tree is edited through pnpm edit-docs:edit-docs rather than by hand, which the same dependency problem prevented, so it is left out deliberately.


Generated by Claude Code

Mind Elixir 5.15 added a fourth way to lay a map out — the root at the top
with its branches hanging below (`direction: 3`, `initDown()`) — but left it
out of its own toolbar, so nothing offered it.

The direction bar carries it now, beside the three it already had. Its mark
is the rightward one turned a quarter turn, which is what the layout itself
is: Mind Elixir ships no mark for a direction its bar never showed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BuQw511c5ZdCHkvGzSwvyR
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🖥️ App preview is ready!

🔗 Preview URL: https://pr-10940.trilium-app.pages.dev
📖 Production URL: https://app.triliumnotes.org

✅ All checks passed

This preview will be updated automatically with new commits.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds the downward Mind Elixir layout to the mind-map direction toolbar.

  • Adds a fourth direction action backed by initDown() and direction value 3.
  • Adds localized button text, a rotated direction glyph, CSS mask styling, and toolbar tests.

Confidence Score: 4/5

The PR appears safe to merge after the non-blocking SVG formatting issue is addressed.

The downward layout is consistently wired through the toolbar, localization, styling, and tests; the only accepted concern is that the new SVG violates the repository's source-formatting requirement.

Files Needing Attention: apps/client/src/widgets/type_widgets/mind_map/direction-down.svg

Important Files Changed

Filename Overview
apps/client/src/widgets/type_widgets/mind_map/MapToolbar.tsx Adds the downward direction entry using the Mind Elixir 5.15.1 initDown() API.
apps/client/src/widgets/type_widgets/mind_map/MapToolbar.spec.tsx Extends the direction mock and assertions to cover rendering, activation, and invocation of the fourth layout.
apps/client/src/widgets/type_widgets/mind_map/MapToolbar.css Adds the scoped CSS mask rule for the downward-direction icon.
apps/client/src/widgets/type_widgets/mind_map/direction-down.svg Adds the rotated rightward glyph, but serializes the asset on one line contrary to the repository line-length rule.
apps/client/src/translations/en/translation.json Adds the English label for the downward direction button.

Fix All in Claude Code

Reviews (1): Last reviewed commit: "feat(mind map): offer the downward layou..." | Re-trigger Greptile

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><g transform="rotate(90 512 512)"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z"/></g></svg>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Overlong SVG source line

The entire SVG, transform, and path are serialized on one line substantially longer than the repository's 100-character limit, making this asset harder to review and maintain.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Base automatically changed from renovate/mind-elixir-5.x to main August 8, 2026 09:30
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 1.19kB (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
standalone-esm 53.33MB 1.19kB (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: standalone-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
src/dist-*.js 7 bytes 63 bytes 12.5% ⚠️
src/dist-*.js -7 bytes 56 bytes -11.11%
src/MindMap-*.js 98 bytes 119.69kB 0.08%
src/MindMap-*.css 1.1kB 22.76kB 5.06% ⚠️
assets/en-*.js 709 bytes 1.29kB 121.2% ⚠️
assets/en-*.js -709 bytes 585 bytes -54.79%
view changes for bundle: client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
src/dist-*.js 19 bytes 82 bytes 30.16% ⚠️
src/dist-*.js -19 bytes 63 bytes -23.17%

@eliandoran
eliandoran merged commit ed8ec3c into main Aug 8, 2026
10 checks passed
@eliandoran eliandoran added this to the v0.105.0 milestone Aug 8, 2026
@eliandoran
eliandoran deleted the claude/theme-management-review-yet2z7 branch August 8, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants