feat: directional sync + devcontainer demo + graph polish/persistence#43
Merged
Conversation
… button
- Edges are now translucent so they don't visually merge with nodes
of the same color: path edges at 0.5 alpha, reference edges at
0.55. Path edge width bumped 1px → 1.5px to compensate for the
softer contrast.
- Arrowheads stay opaque via linkDirectionalArrowColor set to the
full-alpha edge color, so they reliably cover the translucent
line where it would otherwise show through the arrow body. Arrow
length shrunk 4 → 2.5 — felt oversized at the new node radius.
- New 'fit all' button in the graph toolbar. Calls
forceGraph.zoomToFit(400ms, 40px padding) — handy when a search
filter has narrowed the visible set down to a few far-apart
nodes, or when the user has zoomed/panned away from the layout.
- withAlpha() helper handles #rgb, #rrggbb, #rrggbbaa, and
rgb()/rgba() forms so the alpha override survives whatever CSS
var format the theme uses.
Adds a per-mapping direction field to the sync config and uses it to
ship a self-documenting devcontainer: on first launch the container
pulls mind-map's own documentation down from the project's GitHub
wiki via the very sync feature we're demonstrating.
## Sync direction
- New SyncMapping.Direction field. Values: 'bidirectional'
(default, backward-compatible), 'pull' (read-only — never push
local changes), 'push' (write-only — never pull remote changes).
- SyncDirection.Normalize() coerces empty/unknown values to
bidirectional so existing configs keep working.
- syncTarget honors direction: pull skips copyFromWiki + commit +
push; push skips copyToWiki + reindex.
- Both modes still fetch+merge so push has a base to push onto and
pull picks up remote changes — only the local copy directions
are gated.
- Regression tests: TestPullOnlyDoesNotPushLocalChanges and
TestPushOnlyDoesNotPullRemoteChanges.
## Devcontainer wiring
- .devcontainer/devcontainer.json bind-mounts the workspace's
.mind-map/ as the vscode user's ~/.mind-map/ so the committed
sync config is what mind-map serve reads.
- .mind-map/config.json declares a single pull-only mapping at
prefix '' pointing at the project's GitHub wiki repo.
- .mind-map/.gitignore keeps everything but config.json out of
git (the wiki content, sqlite index, shadow clones, logs all
get regenerated on first launch).
- .vscode/launch.json drops --dir overrides; defaults route to
~/.mind-map/wiki which is now where sync lands content.
## SKILL.md updates
- Adds move_page to the tools list and a dedicated section
explaining why agents should use it instead of create+delete.
- Adds a 'Wiki Layout (Recommended)' section nudging agents
toward <project-or-area>/<category>/<page>. Not enforced, but
encouraged so prefix-based sync mappings have meaningful
shapes to bite on.
- Adds a 'Sync' section explaining the new direction modes.
## testdata removal
The previous testdata/ contents have been pushed to the GitHub wiki
(33 pages organized as concepts/, architecture/, agents/, design/,
comparisons/, guides/). Fresh devcontainer launches now pull that
content down via sync instead of carrying it in-repo.
Verified end-to-end: rebuilt devcontainer, ran mind-map serve, sync
created the shadow clone and populated 34 pages into the wiki dir
within 1.5 seconds. /api/context returned the full page list.
- On first mount we subscribe to onEngineStop and call
zoomToFit(400, 40) the first time the simulation cools, so the
user always sees the full graph rather than landing on a random
pre-layout fragment.
- onZoomEnd persists the current {k, x, y} transform to
localStorage under 'mm-graph-view'. Subsequent loads restore it
via centerAt + zoom (duration=0) and skip the auto-fit.
- Guarded with a closure-local 'initialViewApplied' flag so the
zoom-end events that fire during the auto-fit animation don't
clobber the meaningful persisted state, and so later simulation
kicks (e.g. theme changes re-feeding data) don't snap the view
back to the auto-fit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A self-documenting devcontainer + the graph polish from last night. Three commits.
1.
9a80027— Graph polish: translucent edges, opaque arrows, fit-all buttonlinkDirectionalArrowColorset to the full-alpha edge color — the arrow reliably covers the translucent line where it would otherwise show through.forceGraph.zoomToFit(400ms, 40px). Handy when a search filter has narrowed the visible set to a few far-apart nodes.withAlpha()helper handles#rgb,#rrggbb,#rrggbbaa, andrgb()/rgba()so the alpha override survives whatever format CSS vars use.2.
7c9a757— Directional sync + devcontainer demo via the wiki itselfThe headline feature: a fresh
git clone+ devcontainer rebuild now downloads mind-map's own documentation from the project's GitHub wiki via the very sync feature we're demonstrating.Sync direction (new code)
SyncMapping.Directionfield. Values:bidirectional(default, backward-compatible),pull(read-only — never push local changes),push(write-only — never pull remote changes).SyncDirection.Normalize()coerces empty/unknown values tobidirectionalso existing configs keep working.syncTargethonors direction:pullskipscopyFromWiki+ commit + push;pushskipscopyToWiki+ reindex. Both modes still fetch+merge so push has a base and pull picks up remote changes — only the local copy directions are gated.TestPullOnlyDoesNotPushLocalChangesandTestPushOnlyDoesNotPullRemoteChanges.Devcontainer wiring
.devcontainer/devcontainer.jsonbind-mounts${localWorkspaceFolder}/.mind-mapas the vscode user's~/.mind-map/so the committed sync config is whatmind-map servereads..mind-map/config.jsondeclares a single pull-only mapping atprefix:""pointing athttps://github.com/aniongithub/mind-map.wiki.git..mind-map/.gitignorekeeps everything butconfig.jsonout of git (wiki content, SQLite index, shadow clones, logs all regenerated on first launch)..vscode/launch.jsondrops--diroverrides — defaults route to~/.mind-map/wikiwhere sync lands content.SKILL.md updates
move_pageto the tools list + a dedicated section explaining why agents should use it instead ofcreate+delete(atomic rename, preserves the link graph).<project-or-area>/<category>/<page>. Not enforced — encouraged so prefix-based sync mappings have meaningful shapes.testdata removal
The previous
testdata/contents have been pushed to the GitHub wiki (33 pages: concepts/, architecture/, agents/, design/, comparisons/, guides/). Fresh devcontainer launches pull that content down via sync instead of carrying it in-repo.Verified end-to-end
Rebuilt the devcontainer, ran
mind-map serve, sync created the shadow clone and populated 34 pages into the wiki dir within 1.5 seconds./api/contextreturned the full page list. Pull-only direction confirmed in logs (no commit/push attempted).3.
acfb1f7— Graph auto-fits on first load, persists pan/zoomonEngineStopand callzoomToFit(400, 40)the first time the simulation cools, so users always land on the full graph rather than a random pre-layout fragment.onZoomEndpersists the current{k, x, y}transform tolocalStorageundermm-graph-view. Subsequent loads restore it viacenterAt+zoom(duration=0) and skip the auto-fit.