mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
refactor(ui): trim the right rail tabs surface, share one DOM fake and one phone breakpoint
rightRailTabs.js exports only createRightRailTabs, nextRailTabIndex and railJoinPath and returns element, sync and destroy; the id constants, railTabPanels, the argument guard and the createElementNS fallback existed for the tests alone. The sub-720px density tier and the slot's focus ring go; the five rail cards carry data-rail-card so the stylesheet lists them once. src/ui/mobileShellContract.js holds the phone shell's media query and class, dependency-free so the rail layout and panel packages can read them; rightPanelRail.js, panelPositionControls.js and radioPanelPlacement.js use it instead of their own literals. src/testSupport/fakeDom.mjs replaces the two hand-made DOM fakes of the rail and strip tests; the rail tests now expect null for a missing attribute, as in the DOM. The two Radio gate checks of the removed several-panels rail policy are gone. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
e05d6a29b4
commit
8c788474db
19 files changed
+273
-396
No files matched your search
@@ -491,8 +491,10 @@ test('the full-width rail cannot inherit a height that overrides its floor', ()
|
||||
// to a mobile mode at the SAME breakpoint and removes both the class and the
|
||||
// custom property. Pin that, or the exemption above is unearned.
|
||||
const rail = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'rightPanelRail.js'), 'utf8');
|
||||
const gate = rail.indexOf("windowRef.matchMedia('(max-width: 720px)')");
|
||||
assert.ok(gate > 0, 'the rail layout pass no longer keys off (max-width: 720px)');
|
||||
const contract = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'mobileShellContract.js'), 'utf8');
|
||||
assert.match(contract, /MOBILE_SHELL_MEDIA_QUERY = '\(max-width: 720px\)'/, 'the shell contract no longer names (max-width: 720px)');
|
||||
const gate = rail.indexOf('windowRef.matchMedia(MOBILE_SHELL_MEDIA_QUERY)');
|
||||
assert.ok(gate > 0, 'the rail layout pass no longer keys off the shell breakpoint');
|
||||
const mobileBranch = rail.slice(gate, rail.indexOf("layoutMode = 'mobile'", gate) + 40);
|
||||
assert.match(mobileBranch, /stack\.classList\.remove\('layout-focus'\)/);
|
||||
assert.match(mobileBranch, /stack\.style\.removeProperty\('--right-stack-max-height'\)/);
|
||||
|
||||
Reference in new issue
Block a user