diff options
| author | Agando <roduccomm@gmail.com> | 2026-11-07 18:28:29 +0100 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-11-07 18:28:29 +0100 |
| commit | 9d16b23a6a64af04a25c6ca950bf6a1cf0ccf07c (patch) | |
| tree | 2e959ede2c11b205e62ab3753eb89cc7685d7623 /modules/core/module-uishell.js | |
| parent | c2f5c87529376c9f0a5d577378505489de8c85b8 (diff) | |
fix(newos4): mode layout constraints, capture() arg split, suppress classic welcome modal
- #ui-root is a flex column (it was display:block, so every mode's flex:1 was inert and the
terminal collapsed to 0px while the composer sat at the bottom of a 4600px flow)
- overflow:clip on #ui-root and body: overflow:hidden is still a scroll container, and the
terminal's scrollIntoView() on new output scrolled the mode's own chrome off-screen
- terminal min-height 100px: in the tabbed/panel modes its grid parent is not a flex parent
- api.capture() split arguments itself; term._parseArgs does not exist, so every panel showed
'unavailable: term._parseArgs is not a function'
- the classic Let's Get Started modal is suppressed in non-classic modes: it covered easy's cards
Diffstat (limited to 'modules/core/module-uishell.js')
| -rw-r--r-- | modules/core/module-uishell.js | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/modules/core/module-uishell.js b/modules/core/module-uishell.js index 63a1437..ac14b20 100644 --- a/modules/core/module-uishell.js +++ b/modules/core/module-uishell.js @@ -306,13 +306,31 @@ class UIShellModule { const st = document.createElement('style'); st.id = 'wx11-ui-base-css'; st.textContent = [ - '#ui-root{position:fixed;inset:0;display:none;overflow:hidden;z-index:40;background:var(--bg-color);color:var(--text-color)}', - 'body[data-ui-mode]:not([data-ui-mode="classic"]) #ui-root{display:block}', + // clip, not hidden: `overflow:hidden` still creates a scroll container, and the terminal's + // scrollIntoView() on new output scrolled #ui-root by 464px — the title, the action cards + // and the composer all left the screen (measured 2026-11-07). `clip` cannot be scrolled. + '#ui-root{position:fixed;inset:0;display:none;overflow:clip;z-index:40;background:var(--bg-color);color:var(--text-color)}', + // flex column, not block: every mode is a vertical stack (chrome / content / composer / + // footer) and a block container makes each child's `flex:1 1 auto` inert — the terminal + // collapsed to 0px and the composer sat at the very bottom of a 4 600px flow. + 'body[data-ui-mode]:not([data-ui-mode="classic"]) #ui-root{display:flex;flex-direction:column;height:100%}', + '#ui-root > *{min-width:0;min-height:0}', + // A non-classic mode owns the viewport: the page itself must not scroll, or terminal + // output drags the action cards off-screen and the composer never comes back. + 'body[data-ui-mode]:not([data-ui-mode="classic"]){overflow:clip}', + 'body[data-ui-mode]:not([data-ui-mode="classic"]) #ui-root{overflow:clip}', 'body[data-ui-mode]:not([data-ui-mode="classic"]) #cmd-cards{display:none!important}', + // A mode IS the onboarding: six cards behind the classic "Let's Get Started" modal is two + // competing first-run prompts, and the modal covered the easy mode's action cards. + 'body[data-ui-mode]:not([data-ui-mode="classic"]) #welcome-modal{display:none!important}', 'body[data-ui-mode]:not([data-ui-mode="classic"]) #ui-root{padding-bottom:34px}', // The stock containers are flex children of <body>; inside a pane they must be able to // shrink, or every mode overflows vertically and the input scrolls off-screen. - '#ui-root #terminal-container{flex:1 1 auto;min-height:0;height:auto;overflow-y:auto;padding:0}', + // basis 0, not auto: with `auto` the terminal takes its 4 600px content height and pushes + // every sibling out of the viewport instead of scrolling inside its own pane. + // min-height 100px, not 0: in the tabbed/panel modes the terminal sits inside a grid cell + // that is not a flex parent, so `flex:1 1 0` resolves to 0 and the output strip vanished. + '#ui-root #terminal-container{flex:1 1 0;min-height:100px;height:0;overflow-y:auto;padding:0}', '#ui-root #input-area{flex:0 0 auto}', '#ui-root #status-bar{flex:0 0 auto}', '#ui-foot{position:absolute;left:0;right:0;bottom:0;height:34px;display:flex;align-items:center;', @@ -370,10 +388,13 @@ class UIShellModule { exec: (line) => term.executeCommand(String(line)), // shell-authored fixed strings only → capturePipeOutput (no security gate) capture: (line) => { - const parts = term._parseArgs(String(line).trim()); + // Do NOT use terminal._parseArgs — it does not exist on the terminal instance; every + // panel rendered "unavailable: term._parseArgs is not a function" (measured 2026-11-07). + const raw = String(line).trim(); + const parts = raw.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) || []; const cmd = parts[0]; if (!cmd) return Promise.resolve(''); - return term.capturePipeOutput(cmd, parts.slice(1), String(line)); + return term.capturePipeOutput(cmd, parts.slice(1), raw); }, fs: term.fs, el: (tag, props, kids) => { |