feat: canvas UX fixes — scroll, fullscreen, InfoTip tooltips, answer stub system #80

Merged
chihlasm merged 28 commits from feature/tree-editor-canvas into main 2026-02-18 17:52:08 +00:00
Showing only changes of commit 66a0fb01a2 - Show all commits

View File

@@ -619,18 +619,21 @@ export function TreeCanvas() {
</div> </div>
) : ( ) : (
// Multiple children: horizontal branching // Multiple children: horizontal branching
<div className="flex flex-col items-center w-full"> // The fork line and child lanes share the same flex container so the
{/* Horizontal fork line */} // line is sized by the actual rendered children, not a hardcoded estimate.
<div <div className="flex items-start justify-center gap-6 w-full relative"
className="h-px bg-border w-full"
style={{ maxWidth: `${orderedChildren.length * 300}px` }}
/>
{/* Child lanes */}
<div
className="flex items-start justify-center gap-6 pt-0 w-full"
style={{ maxWidth: `${orderedChildren.length * 360}px` }} style={{ maxWidth: `${orderedChildren.length * 360}px` }}
> >
{/* Horizontal fork line — absolutely positioned, aligned to child centers.
Spans from center of first lane to center of last lane. */}
<div
className="absolute top-0 h-px bg-border pointer-events-none"
style={{
left: `calc(${100 / (orderedChildren.length * 2)}%)`,
right: `calc(${100 / (orderedChildren.length * 2)}%)`,
}}
/>
{orderedChildren.map(({ child, optionLabel: ol, childIndex }) => ( {orderedChildren.map(({ child, optionLabel: ol, childIndex }) => (
<div <div
key={child.id} key={child.id}
@@ -642,7 +645,6 @@ export function TreeCanvas() {
</div> </div>
))} ))}
</div> </div>
</div>
)} )}
</div> </div>
)} )}