feat(mind map): offer the downward layout in the direction bar - #10940
Conversation
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
|
🖥️ App preview is ready! 🔗 Preview URL: https://pr-10940.trilium-app.pages.dev ✅ All checks passed This preview will be updated automatically with new commits. |
Greptile SummaryAdds the downward Mind Elixir layout to the mind-map direction toolbar.
Confidence Score: 4/5The 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
|
| 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. |
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> | |||
There was a problem hiding this comment.
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!
Bundle ReportChanges will increase total bundle size by 1.19kB (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: standalone-esmAssets Changed:
view changes for bundle: client-esmAssets Changed:
|
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.xrather thanmain, becauseinitDown()does not exist in 5.14 — it needs that bump to land first. GitHub retargets this tomainautomatically 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 inbuildDirections():value: 3→mind.initDown(). Nothing else needed changing;useMapDirectionalready just readsmind.direction, which 5.15 widened to0 | 1 | 2 | 3on its own.direction-down.svg— a new mask. Mind Elixir ships no icon for this layout (its own toolbar still builds onlytbltl/tbltr/tblts), so this is the rightward glyph underrotate(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.json—mind-map.direction-down, "Branches downwards".MapToolbar.spec.tsx— the mock gainsinitDown, 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 installcould not complete in the authoring environment (the lockfile fetcheselectron/node-gypfromcodeload.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:21still describes the direction buttons as "(to the left, to the right, or to both sides)" and needs a fourth option. That tree is edited throughpnpm edit-docs:edit-docsrather than by hand, which the same dependency problem prevented, so it is left out deliberately.Generated by Claude Code