Skip to content

fix(heybox-up): defer the home comment preview to the desktop rail - #276

Merged
CYoJkoY merged 1 commit into
mainfrom
issue-275-preview-defers-to-right-rail
Nov 30, 2026
Merged

CYoJkoY merged 1 commit into
mainfrom
issue-275-preview-defers-to-right-rail

Conversation

@CYoJkoY

@CYoJkoY CYoJkoY commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Linked Issue

Resolves #275

Change summary

  • Make the community-home auto comment preview yield to the desktop right rail: when hot ranking (>=1200px) or shortcuts (>=1500px) are enabled, the first screen stays collapsed as the right-edge tab so the rail is visible instead of being hidden behind body.heybox-up-rail-open.
  • Keep the documented behavior that a preview opened by hand expands and makes the rail yield.
  • Re-evaluate the preview on DESKTOP_RAIL_PREFERENCE_EVENT so toggling a rail module applies immediately without a reload.
  • Add a defaultRightRailClaimsColumn guard (matchMedia + saved preferences, synchronous and DOM-order independent) plus an injectable parameter for tests.
  • Update docs, version metadata (0.12.25), publishing assertions, and a new tests/heybox-up-rail-preview-defer.test.ts covering wide/narrow, all-modules-off, shortcuts-only, live toggle, and manual-open cases.

Verification & Dependencies

  • pnpm typecheck passed.
  • pnpm test passed: 61 files / 934 tests.
  • pnpm build -- --target heybox-up passed and emitted @version 0.12.25.
  • git diff --cached --check clean.
  • No new runtime dependencies. Behavior verified with jsdom regression tests only; no live browser available in this environment, so a manual smoke test at 1200-1499px and >=1500px is recommended.

Review conclusion

PASS - 4.90 / 5.00, no unresolved P0/P1/P2. See the review comment for details.

Permission Notice

This userscript change only affects UI/CSS behavior, documentation, and tests. It does not add permissions or call additional site endpoints.

The community home auto-opens the comment preview on arrival and adds body.heybox-up-rail-open, which the desktop stylesheet uses to hide the right rail. As a result the hot-ranking / shortcuts rail was mounted but invisible, so those settings looked inert at wide viewports.

The auto-preview now yields to the right rail: when hot ranking (>=1200px) or shortcuts (>=1500px) are enabled, the first screen stays collapsed as the right-edge tab so the rail is visible. Manually opening the preview still expands it and makes the rail yield, as documented, and the preview re-evaluates when a rail preference toggles so changes apply live.

Refs: #275
@CYoJkoY

CYoJkoY commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Review report

Verdict: PASS — score 4.90 / 5.00. No unresolved P0/P1/P2 findings.

What changed

bindCommentRail now accepts a rightRailClaimsColumn guard (default defaultRightRailClaimsColumn) and, when it returns true, skips the auto-open branch and folds an already auto-opened preview back to its right-edge tab. watchCommentRail also re-runs route.sync() on DESKTOP_RAIL_PREFERENCE_EVENT so toggling a rail module re-evaluates the preview live. Docs, version (0.12.25), publishing assertions, and a new jsdom test file were added.

Correctness

  • Root cause addressed. The community home auto-opened the preview, set body.heybox-up-rail-open, and the desktop CSS hides #heybox-up-right-rail while that class is present, so the rail toggles looked inert. The guard removes that state when the rail owns the right column.
  • Breakpoint parity with the rail CSS. Guard requires (min-width:1200px) for hot ranking and (min-width:1500px) for shortcuts, matching DESKTOP_CSS where shortcuts are scoped to >=1500px. Verified against desktop.ts.
  • Order independence. The guard reads only matchMedia + saved preferences, so it is correct even though watchCommentRail() runs before watchDesktopShell() mounts the rail DOM.
  • Manual open preserved. A tab/comment-count open sets state.mode="open"; applyMode() re-applies the body class, so the rail yields to the preview as documented, and the guard leaves autoOpened=false paths untouched.
  • Toggle-off reopens. When all rail modules are off, the guard returns false and the preview auto-opens again; covered by test.

Tests

  • New tests/heybox-up-rail-preview-defer.test.ts (6 cases): wide desktop collapses, narrow auto-opens, all-off auto-opens, shortcuts-only below 1500 auto-opens, live hot-ranking toggle folds the preview, manual open preserved.
  • Full suite: 61 files / 934 tests green. pnpm typecheck, pnpm build -- --target heybox-up (@version 0.12.25) green.

Notes (non-blocking, P3)

  1. The guard is exercised via the injectable parameter and jsdom; a live smoke test at 1200-1499px and >=1500px is still recommended since no browser automation is available here.
  2. Live window resize across the 1200/1500px boundary does not re-run route.sync() on its own; it re-evaluates on the next route/preference/page sync. This matches the existing rail behavior (no resize listener in rail.ts) and is not a regression, but worth noting.
  3. Behavior change surfaced to users: the desktop community-home first screen now starts collapsed (right-edge tab) when the rail is showing. Documented in the changelog and user guide.

@CYoJkoY
CYoJkoY merged commit 6adac6c into main Nov 30, 2026
1 check passed
@CYoJkoY
CYoJkoY deleted the issue-275-preview-defers-to-right-rail branch November 30, 2026 03:49
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.

Home comment preview covers the desktop right rail so rail toggles look inert

1 participant