diff --git a/.dsh-version.json b/.dsh-version.json index e763a3e..ab5eda1 100644 --- a/.dsh-version.json +++ b/.dsh-version.json @@ -484,7 +484,7 @@ ] }, "dsh-themes": { - "version": "0.1.0-alpha.34", + "version": "0.1.0-alpha.35", "rows": [ "themes" ], diff --git a/README.md b/README.md index c7fa283..26fde62 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ way and what it touches. The exact versions are in | [`dsh-skills`](packages/dsh-skills/README.md) | The Skills browser: a header button opens every skill this conversation loads, with its markdown and inline editing. It reads the same registry the agent does, so what you see is what is in effect. | | [`dsh-sql-server`](packages/dsh-sql-server/README.md) | Seven `sql_*` tools over a container this row owns or the `sqlcmd` already on PATH. It keeps apart the four facts that fail independently: a server, a client, a listening port and the machine-wide ODBC driver. `sql_server start` waits until the server answers a statement, and `sql_script` loads a dump with BOM-aware code pages. | | [`dsh-supercollider`](packages/dsh-supercollider/README.md) | SuperCollider the agent can play: eleven `sc_*` tools over one warm `sclang` session (about 31 ms a call, with state kept) and a hand-written OSC client to `scsynth`. The installed `.schelp` reference is indexed for `sc_help`, and the `.scd` workflow opens in the editor. Five skills teach the language, SynthDefs and live coding, and every example in them is compiled by a check. | -| [`dsh-themes`](packages/dsh-themes/README.md) | Header controls for themes (Nord, Monokai, Hacker, Cyber), screenshot and page zoom, the Markdown paper and the pack branding, and the app-wide scrollbars (16px on both axes, with a thumb that reads on the light page). It also hides the shipped account-menu Feedback row. | +| [`dsh-themes`](packages/dsh-themes/README.md) | Header controls for themes (Nord, Monokai, Hacker, Cyber), screenshot and page zoom, the Markdown paper and the pack branding, the app-wide scrollbars (16px on both axes), and the left band's row of Settings, Plugins, Media, Skills, Feedback and Sign in. It also hides the shipped account-menu Feedback row, whose door the band now carries. | | [`dsh-ui-state`](packages/dsh-ui-state/README.md) | The pack's own UI state, remembered host-side: zoom, theme, dock and column widths. It outlives the process, so a restart keeps the layout you left. | | [`dsh-video`](packages/dsh-video/README.md) | A player tab that streams and seeks any container the browser can decode. An ffprobe facts panel names codec, size and frame rate, and one click remuxes when the browser cannot decode it. | | [`dsh-vn-master`](packages/dsh-vn-master/README.md) | The pack's final layer: it installs last, so its row decisions win. It disables the four feedback/telemetry rows and the pack's own `browser` row, which is built and shipped deliberately off. Pack-wide row patches belong here. | diff --git a/packages/dsh-themes/lib/client.js b/packages/dsh-themes/lib/client.js index ba3a8aa..5cc6d6b 100644 --- a/packages/dsh-themes/lib/client.js +++ b/packages/dsh-themes/lib/client.js @@ -254,7 +254,7 @@ window.__ModuleLoader__.load({ /** The slot id of the Themes occupant in the header utilities list. */ const THEMES_ID = 'dsh-themes' /** Version marker, logged at activation so a fresh bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.34' + const PLUGIN_VERSION = '0.1.0-alpha.35' /** The client service (@deepseek-ai/dsh-client-ui-theme) that owns the preference. */ const THEME_SERVICE = 'theme' /** @@ -421,6 +421,13 @@ window.__ModuleLoader__.load({ html .hHd-Xa_root.hHd-Xa_collapsed .dst-band{display:none} html:has([data-dsh-themes-band]) .hHd-Xa_panelList{display:none} html:has([data-dsh-themes-band]) .hHd-Xa_footArea [aria-haspopup="dialog"]{display:none} +/* alpha.35: the band carries Settings, Feedback and Sign in now, so the foot's + settings block would be a second copy of the same three doors in the same + column. Hiding it does NOT break the band's clicks: a display:none control + still takes a programmatic click, and the band presses exactly those controls. + A profile without this row keeps the shipped block, because the rule is + gated on the band having mounted. */ +html:has([data-dsh-themes-band]) .hHd-Xa_settingsArea{display:none} /* The band's Skills button is the pack's ONE Skills entry point. dsh-skills also registers a book icon in the conversation header; with the band mounted that is a second door to the same dialog, so the header one is hidden - not @@ -1802,7 +1809,7 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 } // --------------------------------------------------------------------- - // The band's SECOND ROW: Settings | Plugins | Media (alpha.29). + // The band's SECOND ROW: Settings | Plugins | Media | Skills | Feedback | Sign in (alpha.35). // // THE HOLE. The left column's band is 76px (installLeftTopBar): the top 40px // carry the mark, the product text and the collapse toggle, the mid-band @@ -1813,8 +1820,8 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 // workspaces region and the foot, and the two at the top are single-occupant, // aria-hidden decoration this package already hides. // - // WHAT THIS DOES. The theme mounts its own strip into that row: FOUR icon - // buttons - Settings, Plugins, Media, Skills, in that order - and each one is + // WHAT THIS DOES. The theme mounts its own strip into that row: SIX icon + // buttons - Settings, Plugins, Media, Skills, Feedback, Sign in - and each one is // the SAME .dst-button the header's controls are (28x28, the same .5px // outline, a 15px glyph), so the app has ONE button size rather than a band // that invented a second. Each names itself in a tooltip on hover. The strip @@ -1862,6 +1869,8 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 const PluginsGlyph = glyphOf(['IconPluginPinwheelOutlineRegular', 'IconPluginPinwheelOutline16']) const MediaGlyph = glyphOf(['IconPlayOutlineRegular', 'IconPlayOutline16']) const SkillsGlyph = glyphOf(['IconSkillOutlineRegular', 'IconSkillOutline16']) + const FeedbackGlyph = glyphOf(['IconPaperPlaneOutlineRegular', 'IconPaperPlaneOutlineMedium', 'IconSendOutlineRegular']) + const SignInGlyph = glyphOf(['IconUserOutlineRegular', 'IconUserOutlineMedium']) /** * Resolve one CLIENT service, or null - never an import and never a hard @@ -1952,9 +1961,15 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 // The fourth element: the Skills browser the header carries, driven through // its own control so the dialog keeps the session it was opened for. items.push({ id: 'skills', label: 'Skills', icon: SkillsGlyph, onSelect: props.openSkills }) + // Feedback and Sign in, in the same row (alpha.35). Both are rows of the + // shipped account menu; the band opens that menu and presses the row, so + // the action (the feedback form with its diagnostics, the sign-in flow) is + // still the account seat's own and nothing here re-implements it. + items.push({ id: 'feedback', label: 'Feedback', icon: FeedbackGlyph, onSelect: props.openFeedback }) + items.push({ id: 'signin', label: 'Sign in', icon: SignInGlyph, onSelect: props.openSignIn }) return h( 'div', - { className: 'dst-band', role: 'group', 'aria-label': 'Settings, Plugins, Media, Skills' }, + { className: 'dst-band', role: 'group', 'aria-label': 'Settings, Plugins, Media, Skills, Feedback, Sign in' }, items.map((item) => h(BandAction, { key: item.id, ...item })), ) } @@ -1983,15 +1998,69 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 try { const sidebar = document.querySelector('.' + SIDEBAR_CLASS + '_root') if (sidebar === null) return - // The shipped settings panel's trigger, scoped to THIS column: the one - // control in the sidebar that declares a dialog. Nothing else is clicked. - const trigger = sidebar.querySelector('[aria-haspopup="dialog"]') + // The shipped settings trigger lives in the settings AREA of the foot; + // scoping to it first is what keeps this click from landing on some + // other dialog opener the sidebar may carry earlier in the DOM (the + // 0.2.2 sidebar has more than one `aria-haspopup="dialog"`). The + // whole-column search stays as the fallback for a line that moved it. + const area = sidebar.querySelector('.' + SIDEBAR_CLASS + '_settingsArea') + const trigger = (area === null ? sidebar : area).querySelector('[aria-haspopup="dialog"]') if (trigger !== null && typeof trigger.click === 'function') trigger.click() } catch (err) { /* a shell that moved the trigger keeps a working row and no shortcut */ } } + /** + * Press one row of the shipped account menu, which is where Feedback and + * Sign in live. The trigger and the rows are the account seat's own, so the + * actions (the feedback form with its diagnostics, the sign-in flow) are + * unchanged; this only routes the click. + * + * A menu that is already open is used as it is - clicking its trigger again + * would close it - and the row is matched on its visible label because the + * primitive renders rows with no stable per-row id. Both spellings are + * listed: the pack ships an English UI, and a Chinese locale would say the + * same thing in its own words. + * @param labels - the row labels to try, in order. + */ + const openAccountRow = (labels) => { + const findRow = () => { + const rows = Array.from(document.querySelectorAll('[role="menuitem"]')) + const wanted = labels.map((label) => label.toLowerCase()) + for (const row of rows) { + const text = String(row.textContent ?? '').trim().toLowerCase() + if (text !== '' && wanted.some((label) => text.includes(label))) return row + } + return null + } + try { + const open = findRow() + if (open !== null) { + open.click() + return + } + const sidebar = document.querySelector('.' + SIDEBAR_CLASS + '_root') + if (sidebar === null) return + const area = sidebar.querySelector('.' + SIDEBAR_CLASS + '_settingsArea') + const trigger = (area === null ? sidebar : area).querySelector('[aria-haspopup="menu"]') + if (trigger === null || typeof trigger.click !== 'function') return + trigger.click() + // The menu is portalled on the frame after the click. + const press = () => { + const row = findRow() + if (row !== null) row.click() + } + if (typeof requestAnimationFrame === 'function') requestAnimationFrame(press) + else setTimeout(press, 16) + } catch (err) { + /* a control that moved is not worth an exception in a click handler */ + } + } + + const openFeedback = () => openAccountRow(['Feedback', '反馈', '反馈']) + const openSignIn = () => openAccountRow(['Sign in', 'Sign In', '登录', 'Signin']) + const openSkills = () => { try { // The header's own Skills control, which carries the session id the @@ -2040,7 +2109,17 @@ body[data-ds-dark-theme] ::-webkit-scrollbar-thumb:hover{background-color:rgba(2 const paint = () => { if (reactRoot === null) return - reactRoot.render(h(BandActions, { panels: declaredPanels(ctx), selectPanel, openSettings, openSkills, openMedia })) + reactRoot.render( + h(BandActions, { + panels: declaredPanels(ctx), + selectPanel, + openSettings, + openSkills, + openMedia, + openFeedback, + openSignIn, + }), + ) } const ensure = () => { diff --git a/packages/dsh-themes/package.json b/packages/dsh-themes/package.json index 388f3bb..bce9080 100644 --- a/packages/dsh-themes/package.json +++ b/packages/dsh-themes/package.json @@ -1,6 +1,6 @@ { "name": "dsh-themes", - "version": "0.1.0-alpha.34", + "version": "0.1.0-alpha.35", "description": "Themes and header dress: the conversation header's own controls (page zoom, Screenshot, Themes, session-log download), the Nord/Monokai/Hacker/Cyber palettes, and the pack's appearance overrides - Markdown paper, the branding band, the account menu's Feedback row removed, and the right bar's resize seam.", "type": "module", "main": "lib/index.js", diff --git a/scripts/checks/check-client-bundles.mjs b/scripts/checks/check-client-bundles.mjs index 5aeb9bc..e416a28 100644 --- a/scripts/checks/check-client-bundles.mjs +++ b/scripts/checks/check-client-bundles.mjs @@ -1994,18 +1994,40 @@ check( themesCss.includes('.dst-button{width:28px;height:28px;box-sizing:border-box;'), ) check( - 'the band carries four destinations, Skills last', + 'the band carries six destinations: Settings, Plugins, Media, Skills, Feedback, Sign in', themesSource.includes("id: 'settings'") && themesSource.includes("id: 'plugins'") && themesSource.includes("id: 'media'") && themesSource.includes("id: 'skills'") && + themesSource.includes("id: 'feedback'") && + themesSource.includes("id: 'signin'") && themesSource.indexOf("id: 'skills'") > themesSource.indexOf("id: 'media'") && - themesSource.indexOf("id: 'media'") > themesSource.indexOf("id: 'plugins'"), + themesSource.indexOf("id: 'media'") > themesSource.indexOf("id: 'plugins'") && + themesSource.indexOf("id: 'feedback'") > themesSource.indexOf("id: 'skills'") && + themesSource.indexOf("id: 'signin'") > themesSource.indexOf("id: 'feedback'"), ) check( 'the bottom rows are hidden once the band is the navigation', themesCss.includes('html:has([data-dsh-themes-band]) .hHd-Xa_panelList{display:none}') && - themesCss.includes('html:has([data-dsh-themes-band]) .hHd-Xa_footArea [aria-haspopup="dialog"]{display:none}'), + themesCss.includes('html:has([data-dsh-themes-band]) .hHd-Xa_footArea [aria-haspopup="dialog"]{display:none}') && + themesCss.includes('html:has([data-dsh-themes-band]) .hHd-Xa_settingsArea{display:none}'), +) +// Settings' trigger is found inside the foot's settings AREA first: the 0.2.2 +// sidebar carries more than one `aria-haspopup="dialog"`, so a whole-column +// first match can land on another opener and the button appears dead. +check( + 'the Settings button scopes its trigger to the settings area', + themesSource.includes("sidebar.querySelector('.' + SIDEBAR_CLASS + '_settingsArea')") && + themesSource.includes("(area === null ? sidebar : area).querySelector('[aria-haspopup=\"dialog\"]')"), +) +// Feedback and Sign in are rows of the shipped account menu: the band opens that +// menu and presses the row, so the actions stay the account seat's own. +check( + 'Feedback and Sign in are routed through the account menu rows', + themesSource.includes('const openAccountRow = (labels) =>') && + themesSource.includes('document.querySelectorAll(\'[role="menuitem"]\')') && + themesSource.includes("openAccountRow(['Feedback'") && + themesSource.includes("openAccountRow(['Sign in'"), ) check( 'Skills is driven through the header control that carries the session', @@ -2030,7 +2052,7 @@ check( ) check( 'Settings drives the shipped trigger, scoped to this column', - themesSource.includes('sidebar.querySelector(\'[aria-haspopup="dialog"]\')'), + themesSource.includes("_settingsArea')") && themesSource.includes('.querySelector(\'[aria-haspopup="dialog"]\')'), ) check( 'Plugins still selects the shell\'s own panel id',