Skip to content

shell: add 'off' to the force-touch cycle (auto/force/off) - #167

Open
mparrett wants to merge 1 commit into
mainfrom
shell/touch-off-cycle
Open

shell: add 'off' to the force-touch cycle (auto/force/off)#167
mparrett wants to merge 1 commit into
mainfrom
shell/touch-off-cycle

Conversation

@mparrett

@mparrett mparrett commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

This PR is about the shell's touch UI toggle. (here referenced as "force-touch" since it originally forced the UI on in layouts where it would normally be invisible).

image

The ▦ dev toggle in the shell initially was a boolean: force (touch UI pinned on) or auto (pointer-capability detection). I discovered in testing in desktop browers, it is helpful to have an explicit off option. The current auto isn't necessarily off — portrait's media query and a coarse pointer both reveal the touch UI regardless, so there was no way to suppress it when a reveal path fires but the UI isn't wanted: a phone with a Bluetooth keyboard, or a narrow/portrait desktop window.

This PR adds a natural third state to the cycle: autoforceoff.

How: off sets body.no-touch, which beats both reveal paths for .touch on plain specificity (no !important) and releases the portrait 55dvh terminal cap, so the grid refits to the full viewport.

Recoverability: the switcher and settings pane stay visible under mode-dev only, the same contract that already kept ▦ reachable on a plain desktop. A dev can always cycle back out; players never see the toggle, so they can't strand themselves in a touch-less state on a phone.

The persisted value moves from '1'/'0' to the mode name; a stored legacy '1' maps to force on load, so nobody's existing override resets. (mostly a non-issue for anyone except me right now, but minions love to defensively add backward compat for everything. c'est la vie)

Validated manually and with Playwright in a portrait viewport, tapping through the full cycle and back to auto: in off the touch grid hides, the terminal grows from 495px to 847px and refits, and the mode-dev switcher remains as the way back.

🤖 Co-authored with Claude Code

The ▦ toggle was a boolean: force (pinned on) or auto (capability
detection — and portrait's media query still reveals the UI). There
was no way to suppress the touch UI when a reveal path fires anyway:
phone with a BT keyboard, narrow/portrait desktop windows.

Third state 'off' sets body.no-touch, which out-specifies both reveal
paths for .touch and releases the portrait 55dvh cap so the terminal
reclaims the viewport. The switcher and settings pane stay visible
under mode-dev only — same recoverability contract that already kept
▦ reachable on desktop — so a dev can always cycle back out; players
never see the toggle and can't strand themselves.

Stored value moves from '1'/'0' to the mode name; a legacy '1' maps
to 'force' on load.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mparrett
mparrett requested a review from nnunley July 23, 2026 00:41
@mparrett mparrett added the deploy-preview Publish a gh-pages WASM preview for this PR label Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Note

Add ?mode=dev or else this PR's feature will not be visible.

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://nooga.github.io/xsofy/pr-preview/pr-167/

Built to branch gh-pages at 2026-07-23 22:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@mparrett

Copy link
Copy Markdown
Collaborator Author

Review context for this and the other five ready PRs, with suggested order and merge-order notes: #182

@nnunley

nnunley commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Perhaps the better UI would be a dropdown selection for the mode, rather than toggle cycling. Having tooltips for what each do would be helpful, too.

On chrome, I'm unable to enter the console still. It's ` right?

@mparrett

mparrett commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Perhaps the better UI would be a dropdown selection for the mode, rather than toggle cycling. Having tooltips for what each do would be helpful, too.

On chrome, I'm unable to enter the console still. It's ` right?

@nnunley Thanks for taking a look and agree there's better UI. I'll capture this dimension with or along with the other UI spikes.

And yeah, that's the right key. Add ?mode=dev. Doesn't activate until after first descent. https://xsofy.quest/pr-preview/pr-167/?mode=dev

@mparrett

mparrett commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

FYI, there are a few notes left over here: #182 in case it helps with testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-preview Publish a gh-pages WASM preview for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants