GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — fix(web): keep the desktop sidebar resizable by pandec · Pull Request #53 · pandec/t3code Conversation
Owner
WhyResizing the desktop sidebar had two ways to feel dead, on top of the upstream cause that turned out to be behind the original report. Upstream cause (already fixed, for context): builds predating pingdotgg#4655 read 1. The clamp is too aggressive on narrow windows. 2. The persisted-width restore overwrote live drags. Callers pass their resizable options as an object literal, so What changed
VerificationDriven against the running Electron dev app over CDP (native-input paths, not just jsdom):
17 tests pass,
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsScale the main-content reservation down to half the window on narrow viewports, so a default-sized desktop window can still widen the sidebar instead of starting pinned at its cap, and measure the rail's acceptance check with the same helper as the clamp. Restore the persisted width once per storage key: the effect re-ran on every parent render (callers pass resizable options as an object literal) and overwrote a live drag with the pre-drag width. Codex review findings on the first commit: - Hydrating once per storage key removed the accidental re-clamp the old effect performed on every render, so shrinking the window left an oversized sidebar squeezing the main content until the next drag. Split restoring from reconciling: reconciliation is idempotent, skips live drags, and keeps the user's preferred width unpersisted so a window that grows again restores it. - Reserve the odd pixel of a narrow viewport for the main content, so the sidebar stays at or below half the window. Parse the applied width strictly as pixels: the resize path only writes px, and reading the provider's "16rem" default as 16 would collapse the sidebar to its minimum.
Owner
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Codex review round 2: - A sidebar that switched storage keys inherited the previous key's preferred width whenever the new key had nothing stored, so an unrelated sidebar's width leaked across. Tag the preference with the key that owns it and ignore it under any other key. - Reconciliation applied a width without consulting shouldAcceptWidth, so a caller's non-numeric constraint could be violated even though the numeric limits held. Route it through the same gate as a drag. Document that limit reconciliation only covers pixel widths: a sidebar left on the provider's rem default opts out until its first drag. That gap predates this branch, and normalising component-owned defaults would make the effect fire on every render for collapsed sidebars. Codex review round 3: - stopResize settled against whatever options were current when the pointer came up, so options changing mid-drag could persist the result under the wrong storage key or notify the wrong callback. A drag now captures its options at pointer-down and settles against those. - Leaving a storage key and returning to it looked already-hydrated, so the key's persisted width was never reloaded. Track the observed key separately from the hydrated one, and let a drag in flight finish before restoring. - Clamping an out-of-bounds width back inside the limits is mandatory, so it no longer consults shouldAcceptWidth: a caller that rejects shrinking would otherwise stay pinned above a maxWidth that just dropped. The predicate still governs optional movement between two valid widths.
Owner
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |