From 77f69451c49e2d46b0eaf4a9ab785839b33dbefa Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Mon, 28 Sep 2026 19:51:17 +0200 Subject: [PATCH] fix: use protocol 0.6.2 and remove chat scroll backports --- packages/viewer/package.json | 4 +-- patches/@boardgamers__protocol@0.6.1.patch | 42 ---------------------- patches/README.md | 1 - pnpm-lock.yaml | 13 +++---- pnpm-workspace.yaml | 5 +-- 5 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 patches/@boardgamers__protocol@0.6.1.patch delete mode 100644 patches/README.md diff --git a/packages/viewer/package.json b/packages/viewer/package.json index 0c31ad8..e07e4b2 100644 --- a/packages/viewer/package.json +++ b/packages/viewer/package.json @@ -1,6 +1,6 @@ { "name": "outpost-viewer", - "version": "0.1.8", + "version": "0.1.9", "description": "Browser viewer for the Outpost game on boardgamers.space", "license": "AGPL-3.0", "files": [ @@ -16,7 +16,7 @@ "preview": "vite preview" }, "dependencies": { - "@boardgamers/protocol": "0.6.1", + "@boardgamers/protocol": "0.6.2", "outpost-engine": "workspace:*" }, "devDependencies": { diff --git a/patches/@boardgamers__protocol@0.6.1.patch b/patches/@boardgamers__protocol@0.6.1.patch deleted file mode 100644 index 692d6b9..0000000 --- a/patches/@boardgamers__protocol@0.6.1.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/dist/chat-viewport.js b/dist/chat-viewport.js -index 84fdef2bdf411584349a54362663a379d6778808..e322c2a25c0456ada442bbbff2d49494d0db952b 100644 ---- a/dist/chat-viewport.js -+++ b/dist/chat-viewport.js -@@ -74,6 +74,11 @@ export function bindChatViewport(list, options) { - chat.markRead(latest.dataset.messageId); - } - } -+ function updateFollowing() { -+ if (list.clientHeight && initialized && list.scrollTop !== programmedScroll) { -+ following = list.scrollHeight - list.scrollTop - list.clientHeight <= 1; -+ } -+ } - function refresh() { - if (disposed || frame !== undefined) { - return; -@@ -81,11 +86,13 @@ export function bindChatViewport(list, options) { - frame = win.requestAnimationFrame(() => { - frame = undefined; - if (list.clientHeight && chat.snapshot.open && (options.isVisible?.() ?? true)) { -+ // Observers can run before the scroll event from a small wheel or touch movement. -+ updateFollowing(); - if (scrollToUnread) { - const row = rows().find((element) => chat.snapshot.unreadIds.includes(element.dataset.messageId ?? "")); - if (row) { - list.scrollTop += row.getBoundingClientRect().top - list.getBoundingClientRect().top; -- following = list.scrollHeight - list.scrollTop - list.clientHeight < 32; -+ following = list.scrollHeight - list.scrollTop - list.clientHeight <= 1; - } - else { - following = true; -@@ -103,9 +110,7 @@ export function bindChatViewport(list, options) { - }); - } - function scroll() { -- if (list.clientHeight && initialized && list.scrollTop !== programmedScroll) { -- following = list.scrollHeight - list.scrollTop - list.clientHeight < 32; -- } -+ updateFollowing(); - refresh(); - } - const resize = new ResizeObserver(refresh); diff --git a/patches/README.md b/patches/README.md deleted file mode 100644 index 9fc4785..0000000 --- a/patches/README.md +++ /dev/null @@ -1 +0,0 @@ -The protocol 0.6.1 patch backports the [shared chat scrolling fix](https://codeberg.org/boardgamers/boardgamers/commit/7b4e1ff6). It prevents slow wheel and touch gestures from snapping back to the newest message. Remove the patch when upgrading to a protocol release containing that fix. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a803d95..fe06d1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -patchedDependencies: - '@boardgamers/protocol@0.6.1': 4ec4a210cf846eebd6d902b2952c029dbcde5ed288f88dba1f9362a8a9caa953 - importers: .: @@ -43,8 +40,8 @@ importers: packages/viewer: dependencies: '@boardgamers/protocol': - specifier: 0.6.1 - version: 0.6.1(patch_hash=4ec4a210cf846eebd6d902b2952c029dbcde5ed288f88dba1f9362a8a9caa953) + specifier: 0.6.2 + version: 0.6.2 outpost-engine: specifier: workspace:* version: link:../engine @@ -70,8 +67,8 @@ importers: packages: - '@boardgamers/protocol@0.6.1': - resolution: {integrity: sha512-/SdqqYrRUNizjGqQygR4kxTZqCOqWfj190Uj/YHI8i0pD4eNXGofZJd2QhkB63n0iSRHMvJJRJReadof151wBg==} + '@boardgamers/protocol@0.6.2': + resolution: {integrity: sha512-6FKgLsB4guCzNww1rkanhrsLHIdQVajDs1B4qNsYcgtUobTBRM2VPt9T4mlc8ZDX4JDQltvJVHuK7XDZ1J556A==} '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -775,7 +772,7 @@ packages: snapshots: - '@boardgamers/protocol@0.6.1(patch_hash=4ec4a210cf846eebd6d902b2952c029dbcde5ed288f88dba1f9362a8a9caa953)': + '@boardgamers/protocol@0.6.2': dependencies: zod: 4.6.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1ee5cfe..dc9c181 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,7 +1,4 @@ packages: - "packages/*" minimumReleaseAgeExclude: - - "@boardgamers/protocol@0.3.1 || 0.3.3 || 0.4.0 || 0.4.2 || 0.5.0 || 0.6.0 || 0.6.1" - -patchedDependencies: - "@boardgamers/protocol@0.6.1": patches/@boardgamers__protocol@0.6.1.patch + - "@boardgamers/protocol@0.3.1 || 0.3.3 || 0.4.0 || 0.4.2 || 0.5.0 || 0.6.0 || 0.6.1 || 0.6.2"