Skip to content

Merge upstream into multi-source (#390 / #391)#2

Merged
ethfumi merged 3 commits into
mainfrom
feat/app-multi-db
Jul 15, 2026
Merged

Merge upstream into multi-source (#390 / #391)#2
ethfumi merged 3 commits into
mainfrom
feat/app-multi-db

Conversation

@ethfumi

@ethfumi ethfumi commented Jul 15, 2026

Copy link
Copy Markdown
Owner

upstream の fujibee#390 (pane divider) / fujibee#391 (persist UI settings) を取り込んで、衝突を解決した。fork 側で CI を通すのと、fork のデフォルトブランチを最新に追いつかせるのを兼ねる。

衝突は app/src/App.tsx の app-user プロンプト条件 1 ヶ所のみ。fujibee#391 の抑制フラグと、複数 source の「local だけを見る」条件の両方を残した。read-only な remote 上の APP_USER_TYPE メンバーは、composer がローカルへ書く以上、ローカルの app user の代わりにはならない。

Windows ローカル: frontend 92 / tsc / Rust 51 通過。macOS と bats はここで確認する。

fujibee and others added 3 commits July 14, 2026 10:22
fujibee#390)

* feat(app): snap pane dividers to terminal cell units, herdr-style gaps

Divider drags now snap to whole terminal columns/rows instead of free
pixel positions — koit prefers the discrete, cell-aligned feel over a
continuous drag. TerminalPane reports its actual cell size (px per
col/row) on every fit; every pane shares the same fixed font today, so
any one of them is representative for snapping math regardless of
which two panes flank a given divider.

The gap between panes is now derived from that same cell size (half a
cell of padding per side, so two adjacent panes' padding sums to one
full cell at the shared seam) instead of a fixed 4px/2px value — closer
to herdr's look, and what koit was actually asking about when the old
fixed gap read as narrower than herdr's.

With the gap now wide enough to read clearly, the divider's own
mid-gap hairline was redundant chrome — hidden by default, shown only
on hover or while that SPECIFIC divider is being dragged (a class
toggled on the divider element itself, not `resizing-col`/`row` on
`body`, which is shared with the sidebar/chat dividers and would have
lit up every same-axis pane divider during an unrelated drag).

Also brightened the pane frame itself into its own `--pane-border`
variable (koit: the shared `--border` was too faint to read as a
visible box at rest) rather than changing `--border` globally, which
27 other rules also depend on.

* fix(app): key the drag-highlight off divider identity, not a DOM ref

co1 review (PR fujibee#390): the previous version toggled the highlight class
directly on the grabbed divider's DOM element. For a 2x2 aligned grid
that survives its own transpose, but a 3+ segment grid transposes into
a different divider shape (grid-segment keys -> single keys), so React
unmounts the original element mid-drag and the highlight silently
disappears.

dividerDragKey (now in paneTree.ts, pure and testable) computes a
divider's identity as [...basePath, ...segmentPath] (or path directly
for an already-single divider) — the same split node's path on both
sides of the transpose, per transposeGrid's own doc. App.tsx now
tracks the dragged divider by this key in state instead of a captured
element, so the highlight survives regardless of which divider ends
up rendering it.
* feat(app): persist UI settings across restarts

Persist to localStorage: Show Team Room / Show User Chat toggles,
terminal font size (now adjustable from Settings), sidebar collapse
state, and window size/position/maximized state (via
tauri-plugin-window-state). Also adds a "don't show again" suppression
for the auto-triggered app-user prompt on team switch.

Currently selected team was already persisted (LAST_TEAM_KEY); no
change needed there. Pane split ratios are left for a follow-up.

* fix(app): restore view toggles via lazy init, not a racy setState effect

co1 review on fujibee#391: showTeamRoom/showUserChat started at `true` and were
corrected by a mount effect's setState — but a persist effect keyed on
the same state captured the initial-render's stale `true` first and
wrote it back to localStorage, corrupting the saved value on every
restart. Lazily restore both from localStorage instead, matching the
sidebarCollapsed/terminalFontSize pattern; the seeding effect now only
pushes the (already-correct) initial value into Rust.

Also validates the restored terminal font size against the Settings
modal's own range (8-24) rather than just `> 0`, so a corrupted/stale
localStorage value can't reach xterm or persist itself back unchecked.

* fix(app): re-report cell size after a live font-size change

co1 rebase-delta review on fujibee#391: the font-size effect calls fit.fit()
(which changes xterm's internal rows/cols) but never called onCellSize,
so fujibee#390's divider snap/gap sizing stayed pinned to whatever font was
active on the .term-pane container's last actual resize — the
ResizeObserver that normally drives onCellSize doesn't fire for a font
change, since the container's own offsetWidth/offsetHeight don't move.
Resolve the app-user prompt in the initial team load, where fujibee#391 (persist UI
settings) and multi-source support both changed the same condition. Everything
else merges cleanly.

Keep both conditions. fujibee#391 adds a suppression flag so a dismissed prompt stays
dismissed across restarts; multi-source narrows the check to the local source,
since the composer writes locally and a member carrying APP_USER_TYPE on a
read-only remote cannot stand in for a local app user. Take fujibee#391's auto flag on
the modal.

Verified on Windows: frontend 92 passed, tsc clean, Rust 51 passed. The macOS
and bats legs run on the fork before this goes back to the PR — a Windows-only
run cannot see cfg(not(windows)) code.
@ethfumi
ethfumi merged commit 1f10556 into main Jul 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants