diff --git a/IMPROVEMENTS.md b/IMPROVEMENTS.md index 3848786..589b517 100644 --- a/IMPROVEMENTS.md +++ b/IMPROVEMENTS.md @@ -310,7 +310,26 @@ This file is the handoff for future implementation work. The local-first workspa - ✅ **Example Library close button not at far right** (`css/style.css`) — `.ex-modal-search` has `flex: 1` but `.ex-search-wrap` has `max-width: 280px`; once the search hits that cap the close button sits right after it instead of at the modal edge. Added `margin-left: auto` to `.ex-modal-close` so it always pins to the far right. - pursue only if usability feedback shows clear value; retain Input → Transform → Output as the default and provide keyboard/reset behavior. +## Priority 34 — Browser UI workflow review (2026-11-16) + +### UX fix + +- ✅ **Temporary-content tooltip incorrectly says every temporary item is a shared session** (`js/state.js`) — examples and uploaded files also use the temporary state. Reworded the tooltip generically so it accurately covers examples, uploads, and shared mappings. + +### Follow-up + +- ✅ **Narrow screens hid Share, Theme, Help, Settings, and About with no overflow path** (`css/style.css`) — the existing session control now becomes a compact ellipsis menu on phones and exposes those secondary actions without adding another header button. +- ✅ **Fresh-profile mobile guidance** — added a focused touch-profile test confirming the desktop/laptop recommendation appears once, dismisses cleanly, and stays dismissed after reload without touching an existing user's workspace. + +## Priority 35 — Full UI control audit (2026-11-16) + +- ✅ **Backup import preview opened behind Settings, making Cancel and close appear broken** — Settings now closes before validation preview and reopens after cancel/close; focused coverage verifies the full invalid-ZIP flow and both visible close controls. Escape continues to work. +- ✅ **Console filter selection was visual-only** — filter buttons now expose synchronized `aria-pressed` state so assistive technology can identify All, Info, Warning, or Error as the active filter. +- ✅ Verified Settings theme/runtime/Explorer preference/layout reset, backup validation preview, destructive confirmations, About/footer links, workspace views, Share, Examples, Help tabs, mode switching, Run, pane format/copy/wrap/upload/download/collapse, header/property add/filter, and responsive secondary actions. + +## Deferred ideas — validate before building + +- Draggable pane reordering: pursue only if usability feedback shows clear value; retain Input → Transform → Output as the default and provide keyboard/reset behavior. - Runnable-session tabs: add only if Explorer testing shows repeated switching friction; do not duplicate the Explorer or reduce editor space unnecessarily. - Replace Workspace import: requires explicit approval, rollback design, and destructive-flow testing. Merge-as-copy remains the safe default. - Linked project files/includes, encryption, collaboration, and cloud synchronization remain out of scope. @@ -339,3 +358,7 @@ This file is the handoff for future implementation work. The local-first workspa - ✅ Latest upstream CI regression: 175/175 passed with 4 workers. - ✅ No source content is uploaded unexpectedly. - ✅ Workspace PR #89 merged into `dev`; production deployment / `dev` → `main` remains an explicit release decision. +# Theme contrast review (completed) + +- Reviewed editor syntax, XML/XSLT tokens, console levels, filters, timestamps, and supporting labels in dark and light themes. +- Increased dark-theme secondary contrast, made inactive console filters recognizable, strengthened light-theme warning contrast, and improved Monaco line-number readability in both themes. diff --git a/css/style.css b/css/style.css index 46349ed..101bdcf 100644 --- a/css/style.css +++ b/css/style.css @@ -16,7 +16,8 @@ --sap-gold: #f5a524; --text-primary: #f1f5f9; --text-secondary: #94a3b8; - --text-dim: #475569; + /* Still subordinate, but readable at the app's small mono text sizes. */ + --text-dim: #64748b; --success: #3fb950; --error: #f85149; --warning: #f5a524; @@ -488,6 +489,7 @@ .session-menu button:hover, .session-menu button:focus { outline: none; background: var(--hover-bg-strong); color: var(--text-primary); } .session-menu button:disabled { opacity: .4; cursor: default; } .session-menu-separator { display: block; margin: 4px 3px; border-top: 1px solid var(--border); } + .session-menu-mobile { display: none !important; } .workspace-view-switcher { display: flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-base); @@ -1291,10 +1293,10 @@ } .console-filter-btn:hover { background: var(--hover-bg); } /* Inactive — each dot has its own muted color so they're distinguishable */ - .console-filter-btn[data-filter="all"] { color: #4a6080; } - .console-filter-btn[data-filter="info"] { color: #2a5a9a; } - .console-filter-btn[data-filter="warn"] { color: #7a5a14; } - .console-filter-btn[data-filter="error"] { color: #7a2828; } + .console-filter-btn[data-filter="all"] { color: #718096; } + .console-filter-btn[data-filter="info"] { color: #5794d8; } + .console-filter-btn[data-filter="warn"] { color: #c28a2c; } + .console-filter-btn[data-filter="error"] { color: #c75b57; } /* Active states — full saturation + border + background tint */ .console-filter-btn.active[data-filter="all"] { color: var(--text-secondary); @@ -1458,7 +1460,8 @@ --text-dim: #64748b; --success: #1a7f37; --error: #cf222e; - --warning: #d97706; + /* Darker amber keeps warning text legible on the near-white console. */ + --warning: #b45309; --scrollbar: rgba(0, 64, 140, 0.18); --kv-row-alt: rgba(0, 64, 140, 0.025); --hover-bg: rgba(0, 64, 140, 0.05); @@ -1475,10 +1478,10 @@ } /* ── LIGHT THEME: console filter buttons ── */ - body.light .console-filter-btn[data-filter="all"] { color: #8090a8; } - body.light .console-filter-btn[data-filter="info"] { color: #5a8ac0; } - body.light .console-filter-btn[data-filter="warn"] { color: #c89030; } - body.light .console-filter-btn[data-filter="error"] { color: #c04040; } + body.light .console-filter-btn[data-filter="all"] { color: #64748b; } + body.light .console-filter-btn[data-filter="info"] { color: #2563a6; } + body.light .console-filter-btn[data-filter="warn"] { color: #a64f08; } + body.light .console-filter-btn[data-filter="error"] { color: #b4232d; } body.light .console-filter-btn.active[data-filter="all"] { color: var(--text-secondary); background: rgba(0,0,0,0.06); } body.light .console-filter-btn.active[data-filter="info"] { color: var(--sap-blue); border-color: var(--sap-blue); background: rgba(0,112,242,0.08); } body.light .console-filter-btn.active[data-filter="warn"] { color: var(--warning); border-color: var(--warning); background: rgba(200,120,0,0.1); } @@ -3018,6 +3021,13 @@ body.light .xpath-results-body-wrap .empty-output-hint .empty-output-icon { bord .header #shareBtn, .header .theme-toggle, .header .help-btn, .header #settingsBtn, .header #aboutBtn { display: none; } .header .explorer-toggle { margin-left: 0; } + .header .current-item { display: block; width: 32px; min-width: 32px; border-left: 0; } + .header .current-item-trigger { width: 32px; height: 32px; padding: 0; justify-content: center; } + .header .current-item-title { display: none; } + .header .current-item-trigger > span:last-child { font-size: 0; } + .header .current-item-trigger > span:last-child::after { content: '\2026'; font-size: 18px; line-height: 1; } + .session-menu { width: 210px; } + .session-menu-mobile { display: block !important; } .header #exBtn { width: 32px; padding: 0; diff --git a/index.html b/index.html index bbca183..e551be0 100644 --- a/index.html +++ b/index.html @@ -284,6 +284,12 @@

Why Use an Online XSLT Debugger?

+ + + + + + @@ -525,10 +531,10 @@

Why Use an Online XSLT Debugger?

0
- - - - + + + +
@@ -742,14 +748,14 @@

Why Use an Online XSLT Debugger?

- +

The entire ZIP is validated before anything is written. Imported workspaces, folders, and sessions receive new IDs; existing work is never replaced.

Validating backup…
- +
diff --git a/js/backup.js b/js/backup.js index 8527930..23164d4 100644 --- a/js/backup.js +++ b/js/backup.js @@ -12,6 +12,7 @@ const BACKUP_MAX_RATIO = 1200; const BACKUP_RECORD_SCHEMA_VERSION = 1; let pendingBackupImport = null; let _backupImportReturnFocus = null; +let _backupImportReturnToSettings = false; function backupJsonBytes(value) { return new TextEncoder().encode(JSON.stringify(value, null, 2) + '\n'); @@ -251,10 +252,15 @@ async function validateWorkspaceBackup(input) { } async function prepareWorkspaceBackupImport(file) { - _backupImportReturnFocus = document.activeElement; const input = document.getElementById('backupImportInput'); if (input) input.value = ''; if (!file) return; + const settings = document.getElementById('workspaceSettingsBackdrop'); + _backupImportReturnToSettings = Boolean(settings?.classList.contains('open')); + _backupImportReturnFocus = _backupImportReturnToSettings + ? document.getElementById('settingsBtn') + : document.activeElement; + if (_backupImportReturnToSettings) closeWorkspaceSettings(); const error = document.getElementById('backupImportError'); if (error) { error.hidden = true; error.textContent = ''; } try { @@ -285,10 +291,21 @@ function closeBackupImportDialog() { document.getElementById('backupImportBackdrop')?.classList.remove('open'); document.body.classList.remove('modal-open'); const returnFocus = _backupImportReturnFocus; + const returnToSettings = _backupImportReturnToSettings; _backupImportReturnFocus = null; - requestAnimationFrame(() => returnFocus?.isConnected && returnFocus.focus()); + _backupImportReturnToSettings = false; + if (returnToSettings && typeof openWorkspaceSettings === 'function') { + void openWorkspaceSettings(); + } else { + requestAnimationFrame(() => returnFocus?.isConnected && returnFocus.focus()); + } } +document.addEventListener('DOMContentLoaded', () => { + document.getElementById('backupImportCloseBtn')?.addEventListener('click', closeBackupImportDialog); + document.getElementById('backupImportCancelBtn')?.addEventListener('click', closeBackupImportDialog); +}); + async function confirmWorkspaceBackupImport() { if (!pendingBackupImport) return; const button = document.getElementById('backupImportConfirmBtn'); diff --git a/js/explorer.js b/js/explorer.js index fdf1b5c..f45670d 100644 --- a/js/explorer.js +++ b/js/explorer.js @@ -789,6 +789,11 @@ async function duplicateCurrentSession() { function syncSessionMenuState() { const duplicate = document.getElementById('sessionMenuDuplicate'); if (duplicate) duplicate.disabled = !sessionController?.getCurrentSession(); + const share = document.getElementById('sessionMenuShare'); + if (share) { + share.disabled = modeManager.isXpath; + share.title = modeManager.isXpath ? 'Sharing is only available in XSLT mode' : ''; + } } function toggleSessionMenu(force) { diff --git a/js/state.js b/js/state.js index 90620ce..be0eedf 100644 --- a/js/state.js +++ b/js/state.js @@ -339,7 +339,7 @@ function setSaveIndicator(state, error = null) { ind.title = state === 'conflict' ? 'This item changed in another tab; choose how to preserve your edits' : state === 'temporary' - ? 'This shared session is open temporarily and will not overwrite your saved work' + ? 'This content is temporary and will not overwrite your saved work until you choose Save…' : state === 'failed' ? `${itemName} could not be saved locally${error?.message ? ': ' + error.message : ''}` : state === 'saving' diff --git a/js/themes.js b/js/themes.js index bcaf634..3bfd07e 100644 --- a/js/themes.js +++ b/js/themes.js @@ -27,8 +27,8 @@ var MONACO_THEME_DARK = { colors: { 'editor.background': '#070c14', 'editor.foreground': '#c8d8e8', - 'editorLineNumber.foreground': '#1e3050', - 'editorLineNumber.activeForeground': '#4a70a8', + 'editorLineNumber.foreground': '#52657d', + 'editorLineNumber.activeForeground': '#8aa4c2', 'editor.lineHighlightBackground': '#0c1826', 'editor.lineHighlightBorderColor': '#182030', 'editorCursor.foreground': '#0070f2', @@ -83,8 +83,8 @@ var MONACO_THEME_LIGHT = { colors: { 'editor.background': '#ffffff', 'editor.foreground': '#1a2535', - 'editorLineNumber.foreground': '#c0cfe0', - 'editorLineNumber.activeForeground': '#6080a0', + 'editorLineNumber.foreground': '#718096', + 'editorLineNumber.activeForeground': '#345d85', 'editor.lineHighlightBackground': '#f0f6ff', 'editor.lineHighlightBorderColor': '#d8e8f8', 'editorCursor.foreground': '#0070f2', diff --git a/js/ui.js b/js/ui.js index 729ef51..23fc6fa 100644 --- a/js/ui.js +++ b/js/ui.js @@ -216,7 +216,9 @@ function setConsoleFilter(filter) { consoleFilter = filter; document.querySelectorAll('.console-filter-btn').forEach(btn => { - btn.classList.toggle('active', btn.dataset.filter === filter); + const active = btn.dataset.filter === filter; + btn.classList.toggle('active', active); + btn.setAttribute('aria-pressed', String(active)); }); // Delegate all filtering (type + text) to applyConsoleSearch. diff --git a/package-lock.json b/package-lock.json index 58cc484..2cbfe76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1663,13 +1663,14 @@ } }, "node_modules/qs": { - "version": "6.15.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", - "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "version": "6.17.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.1.tgz", + "integrity": "sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -1741,15 +1742,15 @@ "license": "MIT" }, "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, diff --git a/tests/e2e/workflows/accessibility.spec.js b/tests/e2e/workflows/accessibility.spec.js index ebc5722..4945220 100644 --- a/tests/e2e/workflows/accessibility.spec.js +++ b/tests/e2e/workflows/accessibility.spec.js @@ -145,6 +145,37 @@ test.describe('accessibility improvements', () => { await expect(region).toHaveAttribute('aria-live', 'polite'); }); + test('console filters expose their selected state', async ({ page }) => { + const all = page.getByRole('button', { name: 'Show all messages' }); + const info = page.getByRole('button', { name: 'Info only' }); + await expect(all).toHaveAttribute('aria-pressed', 'true'); + await expect(info).toHaveAttribute('aria-pressed', 'false'); + await info.click(); + await expect(all).toHaveAttribute('aria-pressed', 'false'); + await expect(info).toHaveAttribute('aria-pressed', 'true'); + }); + + test('backup import preview replaces Settings and returns after cancel', async ({ page }) => { + const dialog = page.locator('#backupImportBackdrop'); + const settings = page.locator('#workspaceSettingsBackdrop'); + await page.evaluate(() => document.getElementById('workspaceSettingsBackdrop').classList.add('open')); + await page.locator('#backupImportInput').setInputFiles({ + name: 'invalid-backup.zip', + mimeType: 'application/zip', + buffer: Buffer.from('not a zip'), + }); + await expect(dialog).toHaveClass(/open/); + await expect(settings).not.toHaveClass(/open/); + await dialog.getByRole('button', { name: 'Cancel', exact: true }).click(); + await expect(dialog).not.toHaveClass(/open/); + await expect(settings).toHaveClass(/open/); + await settings.getByRole('button', { name: 'Close settings' }).click(); + + await page.evaluate(() => document.getElementById('backupImportBackdrop').classList.add('open')); + await page.getByRole('button', { name: 'Close backup import' }).click(); + await expect(dialog).not.toHaveClass(/open/); + }); + // ── Explorer create buttons accessible names ─────────────────────────────── test('Explorer create buttons have accessible names', async ({ page }) => { diff --git a/tests/e2e/workflows/workspace-responsive.spec.js b/tests/e2e/workflows/workspace-responsive.spec.js index b765dc9..46a14b0 100644 --- a/tests/e2e/workflows/workspace-responsive.spec.js +++ b/tests/e2e/workflows/workspace-responsive.spec.js @@ -26,6 +26,32 @@ test.describe('workspace responsive containment', () => { await expect(page.locator('#explorerToggle')).toBeFocused(); }); + test('keeps secondary app actions reachable from the phone session menu', async ({ page }) => { + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto('http://localhost:8000', { waitUntil: 'domcontentloaded' }); + await page.waitForSelector('.monaco-editor'); + + await page.locator('#sessionMenuTrigger').click(); + await expect(page.getByRole('menuitem', { name: 'Share current XSLT' })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: 'Toggle light / dark theme' })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: 'Help & shortcuts' })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: 'Settings' })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: 'About XSLTDebugX' })).toBeVisible(); + }); + + test('shows the dismissible desktop recommendation on a fresh touch profile', async ({ page }) => { + await page.addInitScript(() => Object.defineProperty(navigator, 'maxTouchPoints', { get: () => 5 })); + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto('http://localhost:8000', { waitUntil: 'domcontentloaded' }); + + const notice = page.getByRole('note', { name: 'Desktop browser recommended' }); + await expect(notice).toBeVisible(); + await notice.getByRole('button', { name: 'Continue on mobile' }).click(); + await expect(notice).toBeHidden(); + await page.reload({ waitUntil: 'domcontentloaded' }); + await expect(notice).toHaveCount(0); + }); + test('uses an inline Explorer on wide desktop', async ({ page }) => { await page.setViewportSize({ width: 1440, height: 900 }); await page.goto('http://localhost:8000', { waitUntil: 'domcontentloaded' });