[PR #6011] [MERGED] Fix Conversation swipe alignment and Termux restart leases #7025

Closed
opened 2026-10-23 04:15:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6011
Author: @SpicyMarinara
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/6009-6010-swipe-restart


📝 Commits (4)

  • 98321fa docs: start swipe alignment and Termux restart fixes
  • 13b23bd fix: align Conversation swipes and recover Termux writer leases
  • 33d73b9 fix: preserve user bubble swipe alignment
  • 7c782de test: measure gaps around the Conversation swipe footer

📊 Changes

10 files changed (+156 additions, -108 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 e2e/core-flows.e2e.ts (+20 -1)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+3 -0)
📝 packages/client/src/components/chat/ConversationMessageActions.tsx (+1 -1)
📝 packages/client/src/components/chat/ConversationMessageBubble.tsx (+0 -21)
📝 packages/client/src/components/chat/ConversationMessageGrouped.tsx (+5 -21)
📝 packages/client/src/components/chat/ConversationMessageLine.tsx (+0 -20)
📝 packages/client/src/components/chat/ConversationMessageShared.tsx (+18 -22)
📝 packages/server/src/db/file-backed-store.ts (+17 -18)
📝 scripts/regressions/storage-writer-lock.regression.ts (+89 -4)

📄 Description

Linked issues

Closes #6009
Closes #6010

Why this change

Conversation swipe controls inherited the avatar-column indentation, placing them 51–60 px away from the start of the message row on mobile. Hidden actions also reserved a full row of space.

Termux did not enable Engine's existing writer-liveness socket, and its normal 101-byte socket path exceeded the old 100-byte cutoff. If Android cannot prove that a PID no longer belongs to the old writer, startup then requires manual recovery or a reboot. This is consistent with #6010; the rare failure on the reporter's physical phone was not reproduced.

What changed

  • Reuse the Conversation swipe component at the start of classic, bubble and grouped message rows. Remove duplicated wrappers and collapse unrevealed mobile actions. Keep swipe sizes, preferences, keyboard access and right-aligned user-bubble controls.
  • Enable the existing boot-scoped liveness socket for Termux app-private home storage. Honor native path limits (107 bytes on Linux/Android, 103 on macOS). A refused connection to the same-boot socket proves the writer stopped even when PID ownership is uncertain.
  • Extend existing browser and storage regressions. Keep PID-reuse proof restricted to platforms that implement it in the existing writer-lock fixture.

Validation

Completed locally:

  • pnpm install and pnpm check (includes localization, formatting, lint, TypeScript and production builds).
  • node scripts/run-regressions.mjs --filter storage: 3/3 on macOS and 3/3 in Linux Docker, with isolated data.
  • node scripts/run-regressions.mjs --filter shutdown: 3/3, including production server SIGINT and duplicate-signal shutdown.
  • Targeted Playwright matrix: 18/18 across desktop Chromium, mobile Chromium and mobile WebKit. Covers classic/bubble/grouped layouts, light/dark themes, 320 px widths, navigation, saved swipe preferences, mobile actions and keyboard reply access. The final alignment check passed again on all three browsers after preserving user-bubble alignment.
  • Production Docker image built; health returned ok, a second writer was rejected, and four production browser captures passed.
  • New assertions failed before the fixes: swipe offset and reserved mobile action height; missing Termux liveness scope.

Storage claim boundary

Path or proof Result
New Termux private-home lease, normal 101-byte socket path Real listener created; clean close releases lease
Same boot, force-killed socket owner, PID that still appears alive Reclaimed through socket refusal
Live writer, missing socket, foreign scope, uncertain legacy owner Startup refused
Legacy Termux lease with definitely exited PID Existing recovery preserved
Symlink to storage outside app-private home; unavailable boot identity No new Termux socket scope
Linux 107-byte and 108-byte paths 107 works; 108 safely falls back without a socket

The tests simulate Android platform/home/boot identity on POSIX hosts and use real sockets/process termination. Legacy or unsupported leases still require the existing PID/boot proof or manual recovery. This PR does not establish why the reporter's original PID could not be verified.

Manual verification to complete

  • Manually verify swipe positioning and action reveal in Android WebView, in light and dark themes.
  • Manually verify Ctrl-C and Restart Server on a physical Termux device; confirm a second live server remains blocked.
  • Read and follow CONTRIBUTING.md and independently verify the relevant test plan.

Docs and release impact

Both fixes are recorded under CHANGELOG Unreleased. Reviewed README, android/README, CONTRIBUTING, CONFIGURATION, TROUBLESHOOTING and FAQ together; existing launch/restart instructions remain applicable. No user-facing docs, dependency, schema or version changes.

UI evidence

Before/after screenshots and light-theme captures, using a synthetic chat only.

Summary by CodeRabbit

  • Bug Fixes
    • Conversation swipe controls now align with the start of message rows without leaving unused space below messages.
    • On smaller screens, message action controls remain hidden unless hovered or focused.
    • Termux storage leases can recover after a stopped server without requiring a device reboot, while active writers remain protected.
  • Tests
    • Expanded coverage for conversation layouts and storage writer-lock recovery across supported platforms.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6011 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/6009-6010-swipe-restart` --- ### 📝 Commits (4) - [`98321fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98321fa2c50531348f7178ecdb179af9f219b041) docs: start swipe alignment and Termux restart fixes - [`13b23bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/13b23bd1da089c1107062578597535c37e98f333) fix: align Conversation swipes and recover Termux writer leases - [`33d73b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33d73b9b39896f85e53ca512931bb269843f0a0f) fix: preserve user bubble swipe alignment - [`7c782de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c782de9a23278dc290c483bcc5c6ae40df257f4) test: measure gaps around the Conversation swipe footer ### 📊 Changes **10 files changed** (+156 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `e2e/core-flows.e2e.ts` (+20 -1) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ConversationMessageActions.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ConversationMessageBubble.tsx` (+0 -21) 📝 `packages/client/src/components/chat/ConversationMessageGrouped.tsx` (+5 -21) 📝 `packages/client/src/components/chat/ConversationMessageLine.tsx` (+0 -20) 📝 `packages/client/src/components/chat/ConversationMessageShared.tsx` (+18 -22) 📝 `packages/server/src/db/file-backed-store.ts` (+17 -18) 📝 `scripts/regressions/storage-writer-lock.regression.ts` (+89 -4) </details> ### 📄 Description ## Linked issues Closes #6009 Closes #6010 ## Why this change Conversation swipe controls inherited the avatar-column indentation, placing them 51–60 px away from the start of the message row on mobile. Hidden actions also reserved a full row of space. Termux did not enable Engine's existing writer-liveness socket, and its normal 101-byte socket path exceeded the old 100-byte cutoff. If Android cannot prove that a PID no longer belongs to the old writer, startup then requires manual recovery or a reboot. This is consistent with #6010; the rare failure on the reporter's physical phone was not reproduced. ## What changed - Reuse the Conversation swipe component at the start of classic, bubble and grouped message rows. Remove duplicated wrappers and collapse unrevealed mobile actions. Keep swipe sizes, preferences, keyboard access and right-aligned user-bubble controls. - Enable the existing boot-scoped liveness socket for Termux app-private home storage. Honor native path limits (107 bytes on Linux/Android, 103 on macOS). A refused connection to the same-boot socket proves the writer stopped even when PID ownership is uncertain. - Extend existing browser and storage regressions. Keep PID-reuse proof restricted to platforms that implement it in the existing writer-lock fixture. ## Validation Completed locally: - `pnpm install` and `pnpm check` (includes localization, formatting, lint, TypeScript and production builds). - `node scripts/run-regressions.mjs --filter storage`: 3/3 on macOS and 3/3 in Linux Docker, with isolated data. - `node scripts/run-regressions.mjs --filter shutdown`: 3/3, including production server SIGINT and duplicate-signal shutdown. - Targeted Playwright matrix: 18/18 across desktop Chromium, mobile Chromium and mobile WebKit. Covers classic/bubble/grouped layouts, light/dark themes, 320 px widths, navigation, saved swipe preferences, mobile actions and keyboard reply access. The final alignment check passed again on all three browsers after preserving user-bubble alignment. - Production Docker image built; health returned `ok`, a second writer was rejected, and four production browser captures passed. - New assertions failed before the fixes: swipe offset and reserved mobile action height; missing Termux liveness scope. ### Storage claim boundary | Path or proof | Result | | --- | --- | | New Termux private-home lease, normal 101-byte socket path | Real listener created; clean close releases lease | | Same boot, force-killed socket owner, PID that still appears alive | Reclaimed through socket refusal | | Live writer, missing socket, foreign scope, uncertain legacy owner | Startup refused | | Legacy Termux lease with definitely exited PID | Existing recovery preserved | | Symlink to storage outside app-private home; unavailable boot identity | No new Termux socket scope | | Linux 107-byte and 108-byte paths | 107 works; 108 safely falls back without a socket | The tests simulate Android platform/home/boot identity on POSIX hosts and use real sockets/process termination. Legacy or unsupported leases still require the existing PID/boot proof or manual recovery. This PR does not establish why the reporter's original PID could not be verified. ### Manual verification to complete - [ ] Manually verify swipe positioning and action reveal in Android WebView, in light and dark themes. - [ ] Manually verify Ctrl-C and Restart Server on a physical Termux device; confirm a second live server remains blocked. - [ ] Read and follow `CONTRIBUTING.md` and independently verify the relevant test plan. ## Docs and release impact Both fixes are recorded under CHANGELOG Unreleased. Reviewed README, android/README, CONTRIBUTING, CONFIGURATION, TROUBLESHOOTING and FAQ together; existing launch/restart instructions remain applicable. No user-facing docs, dependency, schema or version changes. ## UI evidence [Before/after screenshots and light-theme captures](https://gist.github.com/SpicyMarinara/b0c69a0337ff5d04c079f74b2c867b01), using a synthetic chat only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Conversation swipe controls now align with the start of message rows without leaving unused space below messages. - On smaller screens, message action controls remain hidden unless hovered or focused. - Termux storage leases can recover after a stopped server without requiring a device reboot, while active writers remain protected. - **Tests** - Expanded coverage for conversation layouts and storage writer-lock recovery across supported platforms. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:15:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7025
No description provided.