Skip to content

Fix Pro-sync pill resolution, conflict-toast churn, collaboration roster, and add create-collection UI - #1693

Merged
mstomar125 merged 5 commits into
NodeSpaceAI:mainfrom
mstomar125:round2-frontend-fixes
Jul 18, 2026
Merged

mstomar125 merged 5 commits into
NodeSpaceAI:mainfrom
mstomar125:round2-frontend-fixes

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Frontend fixes surfaced during live dev-mode validation of Pro sync. Five focused commits.

What's fixed

  1. Pro-sync pill stuck on "sync off" — activeDatabaseSettings() read the DatabaseSettingsNode properties from a nested ['database-settings'] sub-object, but the daemon serializes them FLAT (properties.sync_enabled / .auth_status, per the Core schema). The read now matches the daemon's shape, so the pill can actually resolve to connected.
  2. Conflict toast on every keystroke (single writer) — decideRemoteUpdate now only sets notifyConflict when the incoming db-broadcast version is strictly newer than the local version. A device's own echo (version not ahead) is no longer surfaced as a conflict. (Pairs with the daemon-side self-echo drop in sync#335.)
  3. Collaboration roster: duplicate-key crash + names shown as ids — listMembers dedupes rows by personId (keeping the highest permission), and the membership store resolves display names from the locally-synced person node (FLAT name/email), falling back to the id.
  4. Create-collection UI + collection rendering — a "+ New collection" inline input in the sidebar; collections that are only member_of the root render top-level (not nested under Default); non-content node types are filtered out of the member list, with human-readable type tags / "Untitled …" labels.
  5. Uncaught-error capture — window.onerror / unhandledrejection now forward into the debug-log channel (NDJSON), so frontend crashes are captured in dev-mode logs.

Scope note

The patch was originally authored atop the unmerged issue-1672-channel-wedge-recover branch (#1672/#1685) and has been rebased onto clean main. The markSyncEnabledLocally() FLAT-write correction was omitted here because that method lives only on the unmerged #1685 branch — it belongs with #1685. On main the pill resolves correctly via the FLAT read plus the existing refreshDatabaseSettings() re-pull.

Verification

  • bun run test — 166 files, 4106 tests pass (+2 new: stale-self-echo gate, roster dedupe); zero failures
  • bun run quality:check — eslint 0/0, svelte-check 0 errors
  • Nested→FLAT test fixtures updated in ui-extensions.test.ts, pro-sync-pill.test.ts, pro-sync-settings-refresh.test.ts

🤖 Generated with Claude Code

mstomar125 and others added 5 commits July 18, 2026 14:29
The daemon serializes DatabaseSettingsNode with sync_enabled/auth_status
directly on `properties`, but activeDatabaseSettings() read them from a
nested `['database-settings']` sub-object that never exists at runtime.
`enabled` was therefore always false and the pill could never resolve to
`connected`. Read `properties` flat, and update the pill/settings test
fixtures to seed the same flat shape the daemon emits.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ewer

decideRemoteUpdate() raised a conflict notification for any database
broadcast to an actively-edited node that wasn't a content-matched
own-echo. During rapid typing our own earlier keystrokes echo back with a
version that is not ahead of our optimistic local version but whose content
no longer matches lastSentContent, producing a phantom conflict on every
keystroke. Gate notifyConflict on the incoming version being strictly newer
than the local one (or uncomparable); a stale self-echo is now dropped
silently. Add a regression case for the not-ahead differing-content echo.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
listMembers() could return the same person_id on more than one member_of
edge, crashing the keyed roster {#each} on a duplicate key and wedging the
Collaboration panel on "Loading members…". Collapse duplicates to one row
per person at the highest permission. displayFor() now resolves a person's
name/email from their locally-synced person node (flat properties, cached
in personNames, id fallback) instead of showing the raw id.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The collections store gains createCollection(), a ROOT_COLLECTION_ID so
collections that are only member_of the root render top-level rather than
nested under Default, and a NON_CONTENT_NODE_TYPES filter for
selectedCollectionMembers. The sidebar gets a "+ New collection" inline
input, and the sub-panel filters to content nodes with "Untitled …" labels,
type tags, and per-type icons.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…nnel

Thrown exceptions and unhandled rejections (e.g. a Svelte keyed-each
duplicate-key crash) never pass through the logger methods, so they were
visible only in the webview devtools console. Add window error/
unhandledrejection listeners that forward to the same NDJSON file channel,
gated on window presence and non-test, so normal builds pay nothing.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mstomar125
mstomar125 merged commit eee263a into NodeSpaceAI:main Jul 18, 2026
malibio added a commit that referenced this pull request Jul 18, 2026
…t fix

PR #1693 landed on main while this branch was in review and independently
re-added a version-comparison guard (incomingIsNewer) to decideRemoteUpdate
to fix "conflict toast on every keystroke" — but via a different, still-
needed mechanism than this PR's daemon-side fix: #1693's guard protects
against stale echoes from the sync service (nodespace-sync writes
in-process via NodeService::with_client("sync-service"), a path this PR's
x-ns-client-id gRPC header does not cover), while this PR's daemon-side
suppression eliminates same-gRPC-connection echoes entirely.

Resolution: kept the incomingIsNewer version guard (still needed for
sync-service stale replays) but dropped the content-based
isPlausibleOwnEcho/stashVersion machinery it was paired with (unreachable
now that same-connection echoes never arrive at all). Updated
remote-update-policy.ts's doc comment and tests to describe both
mechanisms and why each is still necessary post-merge.

Co-Authored-By: Claude <[email protected]>
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.

1 participant