Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: enlarge LoRA touch targets (#10692)
Adam Eivy80e7eac39938
diff --git a/client/src/pages/Loras.browser.test.js b/client/src/pages/Loras.browser.test.jsnew file mode 100644index 0000000000..45546504ed--- /dev/null+++ b/client/src/pages/Loras.browser.test.js@@ -0,0 +1,178 @@+// @vitest-environment node+import { afterAll, beforeAll, describe, expect, it } from 'vitest';+import { existsSync } from 'node:fs';+import { join } from 'node:path';+import { fileURLToPath } from 'node:url';+import { createServer } from 'vite';+import react from '@vitejs/plugin-react';+import { chromium } from 'playwright-core';+import { BROWSER_FIXTURE_STARTUP_MS, startBrowserFixture } from '../test/browserFixture.js';++const chrome = [process.env.CHROME_PATH, chromium.executablePath(),+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',+ '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser',+].find(path => path && existsSync(path));++const isFixtureRequest = (origin, route) => {+ const url = new URL(route.request().url());+ return url.origin === new URL(origin).origin && !/^\/(api|socket\.io)(\/|$)/.test(url.pathname);+};++describe.skipIf(!chrome)('LoRA touch targets (#10692)', () => {+ let browser;+ let fixture;+ let origin;++ beforeAll(async () => {+ fixture = await startBrowserFixture({+ name: 'loras-touch-targets', createServer, chromium,+ launchOptions: { executablePath: chrome, args: ['--mute-audio'] },+ viteConfig: temp => ({+ configFile: false,+ cacheDir: join(temp, 'vite-cache'),+ optimizeDeps: { entries: ['src/pages/Loras.jsx'], include: ['react', 'react-dom/client', 'react-router'] },+ root: fileURLToPath(new URL('../..', import.meta.url)),+ plugins: [react(), {+ name: 'loras-touch-fixture',+ enforce: 'pre',+ resolveId(id) {+ if (id === '/loras-fixture.jsx') return '\0loras-fixture.jsx';+ if (/\/services\/api(?:\.js)?$/.test(id)) return '\0loras-api';+ },+ load(id) {+ if (id === '\0loras-api') return `+ export const listLorasFull = async () => [];+ export const installLoraFromCivitai = async () => {};+ export const previewLoraInstall = async () => ({ verdict: 'ok' });+ export const installLoraFromHuggingfaceStream = async () => {};+ export const deleteLoraFull = async () => {};+ export const getCivitaiAuth = async () => ({ hasKey: false, source: 'none' });+ export const setCivitaiAuth = async () => {};+ export const clearCivitaiAuth = async () => {};+ export const getCivitaiSuggestions = async () => ({ runners: {}, video: [], fetchedAt: null });+ export const searchCivitaiLoras = async () => ({ items: [], nextCursor: null });+ export const searchVideoLoras = async () => ({ items: [], nextCursor: null });+ export const probeLoraEffect = async () => {};+ `;+ if (id !== '\0loras-fixture.jsx') return;+ return `+ import React from 'react';+ import { createRoot } from 'react-dom/client';+ import { MemoryRouter } from 'react-router';+ import Loras from '/src/pages/Loras.jsx';+ import '/src/index.css';+ createRoot(document.getElementById('root')).render(+ React.createElement(MemoryRouter, { initialEntries: ['/models/loras'] },+ React.createElement('main', { className: 'w-full min-w-0 p-4' }, React.createElement(Loras)))+ );+ `;+ },+ configureServer(vite) {+ vite.middlewares.use('/loras-test', async (_req, res) => {+ res.setHeader('Content-Type', 'text/html');+ res.end(await vite.transformIndexHtml('/loras-test',+ '<div id="root"></div><script type="module" src="/loras-fixture.jsx"></script>'));+ });+ },+ }],+ server: { host: '127.0.0.1', port: 0 },+ }),+ warmup: async (page, url) => {+ await page.route('**/*', route => (isFixtureRequest(url, route) ? route.continue() : route.abort()));+ await page.goto(`${url}loras-test`);+ await page.getByRole('tab', { name: /Installed/ }).waitFor({ timeout: 10000 });+ },+ });+ ({ browser, origin } = fixture);+ }, BROWSER_FIXTURE_STARTUP_MS);++ afterAll(() => fixture?.close());++ it.each([+ { width: 360, height: 800 }, { width: 768, height: 1024 }, { width: 1440, height: 900 },+ ])('keeps LoRA controls reachable at $width x $height', async viewport => {+ const page = await browser.newPage({ viewport, hasTouch: viewport.width < 640 });+ const errors = [];+ const unexpectedRequests = [];+ page.on('pageerror', error => errors.push(error.message));+ await page.route('**/*', route => {+ if (isFixtureRequest(origin, route)) return route.continue();+ unexpectedRequests.push(new URL(route.request().url()).pathname);+ return route.abort();+ });+ try {+ await page.goto(`${origin}loras-test`);+ await page.getByRole('button', { name: 'All', exact: true }).waitFor();+ const measureAndCheck = async (locator, { filter = false } = {}) => {+ await locator.scrollIntoViewIfNeeded();+ const geometry = await locator.evaluate(element => {+ const rect = element.getBoundingClientRect();+ return {+ left: rect.left, right: rect.right, width: rect.width, height: rect.height,+ centerPlus16Hits: element.contains(document.elementFromPoint(rect.left + rect.width / 2, rect.top + rect.height / 2 + 16)),+ };+ });+ expect(geometry.height).toBeGreaterThanOrEqual(44);+ expect(geometry.left).toBeGreaterThanOrEqual(0);+ expect(geometry.right).toBeLessThanOrEqual(viewport.width);+ if (filter) expect(geometry.centerPlus16Hits).toBe(true);+ };+ const checkToolbar = async () => {+ for (const name of ['All', 'Image', 'Video']) {+ await measureAndCheck(page.getByRole('button', { name, exact: true }), { filter: true });+ }+ };++ await checkToolbar();+ await measureAndCheck(page.getByRole('button', { name: 'Install LoRA', exact: true }));+ const layout = await page.evaluate(() => ({+ pageOverflow: document.documentElement.scrollWidth - innerWidth,+ contentOverflow: document.querySelector('main').scrollWidth - document.querySelector('main').clientWidth,+ }));+ expect(layout.pageOverflow).toBeLessThanOrEqual(0);+ expect(layout.contentOverflow).toBeLessThanOrEqual(0);++ await page.getByRole('tab', { name: /Discover \/ install/ }).click();+ await page.getByLabel('Civitai model URL').waitFor();+ await checkToolbar();+ await measureAndCheck(page.getByLabel('Civitai model URL'));+ await measureAndCheck(page.getByLabel('HuggingFace LoRA URL'));+ await measureAndCheck(page.getByRole('button', { name: 'Install', exact: true }).first());+ await measureAndCheck(page.getByRole('button', { name: 'Install', exact: true }).nth(1));++ const videoSearch = page.getByLabel('Search HuggingFace video LoRAs by name or repository');+ await videoSearch.scrollIntoViewIfNeeded();+ await measureAndCheck(page.getByRole('button', { name: 'All video' } ), { filter: true });+ for (const name of ['LTX-Video', 'MiniMax H3']) {+ await measureAndCheck(page.getByRole('button', { name, exact: true }).last(), { filter: true });+ }+ await measureAndCheck(videoSearch);+ await measureAndCheck(page.getByLabel('Filter HuggingFace video LoRAs by author'));+ const videoForm = videoSearch.locator('xpath=ancestor::form');+ await measureAndCheck(videoForm.getByRole('button', { name: 'Search' }));+ await videoSearch.fill('touch target');+ await videoForm.getByRole('button', { name: 'Search' }).click();+ await measureAndCheck(videoForm.getByRole('button', { name: 'Clear' }));++ const civitaiSearch = page.getByLabel('Search Flux 1 LoRAs on Civitai');+ await civitaiSearch.scrollIntoViewIfNeeded();+ await measureAndCheck(civitaiSearch);+ const civitaiForm = civitaiSearch.locator('xpath=ancestor::form');+ await measureAndCheck(civitaiForm.getByRole('button', { name: 'Search' }));+ await civitaiSearch.fill('touch target');+ await civitaiForm.getByRole('button', { name: 'Search' }).click();+ await measureAndCheck(civitaiForm.getByRole('button', { name: 'Clear' }));++ const finalLayout = await page.evaluate(() => ({+ pageOverflow: document.documentElement.scrollWidth - innerWidth,+ contentOverflow: document.querySelector('main').scrollWidth - document.querySelector('main').clientWidth,+ }));+ expect(finalLayout.pageOverflow).toBeLessThanOrEqual(0);+ expect(finalLayout.contentOverflow).toBeLessThanOrEqual(0);+ expect(errors).toEqual([]);+ expect(unexpectedRequests).toEqual([]);+ } finally {+ await page.close();+ }+ }, 60000);+});diff --git a/client/src/pages/Loras.jsx b/client/src/pages/Loras.jsxindex 5b7ef67422..19ac686d54 100644--- a/client/src/pages/Loras.jsx+++ b/client/src/pages/Loras.jsx@@ -439,13 +439,13 @@ export default function Loras() {ariaLabel="LoRA view"controlsIdPrefix={VIEW_PANEL_PREFIX}/>- <div className="flex items-center gap-3">+ <div className="flex max-w-full flex-wrap items-center gap-2 sm:gap-3"><MediaFilter value={mediaFilter} onChange={setMediaFilter} />{view === VIEW_INSTALLED && (<buttontype="button"onClick={() => setView(VIEW_DISCOVER)}- className="bg-port-accent text-white px-3 py-1.5 rounded text-sm font-medium hover:bg-port-accent/90 flex items-center gap-2"+ className="min-h-11 shrink-0 bg-port-accent text-white px-3 rounded text-sm font-medium hover:bg-port-accent/90 flex items-center justify-center gap-2"><Download size={14} aria-hidden="true" />Install LoRA@@ -502,20 +502,20 @@ export default function Loras() {focusing it was a landing convenience. It now remounts on everyswitch into Discover, where it would steal focus from the tabthe user just activated and swallow their next arrow key. */}- <div className="flex gap-2">+ <div className="flex flex-wrap gap-2 sm:flex-nowrap"><inputtype="text"value={installUrl}onChange={(e) => setInstallUrl(e.target.value)}aria-label="Civitai model URL"placeholder="https://civitai.com/models/2600698/realstagram"- className="flex-1 bg-port-bg border border-port-border rounded px-3 py-2 text-sm text-gray-200 placeholder:text-gray-600"+ className="min-h-11 min-w-0 flex-1 bg-port-bg border border-port-border rounded px-3 py-2 text-sm text-gray-200 placeholder:text-gray-600"disabled={installing}/><buttontype="submit"disabled={installing || !installUrl.trim()}- className="bg-port-accent text-white px-4 py-2 rounded text-sm font-medium hover:bg-port-accent/90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"+ className="min-h-11 bg-port-accent text-white px-4 rounded text-sm font-medium hover:bg-port-accent/90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2">{installing ? 'Downloading…' : 'Install'}</button>@@ -535,20 +535,20 @@ export default function Loras() {<Download size={16} /><span>Install LoRA from HuggingFace</span></div>- <div className="flex gap-2">+ <div className="flex flex-wrap gap-2 sm:flex-nowrap"><inputtype="text"value={hfUrl}onChange={(e) => setHfUrl(e.target.value)}aria-label="HuggingFace LoRA URL"placeholder="https://huggingface.co/Alissonerdx/CharacterSheet"- className="flex-1 bg-port-bg border border-port-border rounded px-3 py-2 text-sm text-gray-200 placeholder:text-gray-600"+ className="min-h-11 min-w-0 flex-1 bg-port-bg border border-port-border rounded px-3 py-2 text-sm text-gray-200 placeholder:text-gray-600"disabled={hfInstalling}/><buttontype="submit"disabled={hfInstalling || !!installingVideoKey || !hfUrl.trim()}- className="bg-port-accent text-white px-4 py-2 rounded text-sm font-medium hover:bg-port-accent/90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"+ className="min-h-11 bg-port-accent text-white px-4 rounded text-sm font-medium hover:bg-port-accent/90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2">{hfInstalling ? (hfPct != null ? `Downloading ${hfPct}%` : 'Downloading…') : 'Install'}</button>@@ -581,7 +581,7 @@ export default function Loras() {{ family },)}disabled={hfInstalling}- className="bg-port-accent text-white px-3 py-1 rounded text-xs font-medium hover:bg-port-accent/90 disabled:opacity-50"+ className="min-h-11 bg-port-accent text-white px-3 rounded text-xs font-medium hover:bg-port-accent/90 disabled:opacity-50">{hfInstalling ? (hfPct != null ? `Installing ${hfPct}%` : 'Installing…') : `Install as ${label}`}</button>@@ -722,16 +722,16 @@ function HfDownloadProgress({ progress }) {// installed list.function MediaFilter({ value, onChange }) {return (- <div className="flex items-center gap-2">+ <div className="flex flex-wrap items-center gap-2"><span className="text-xs text-gray-500">Show</span>- <div className="inline-flex rounded-lg border border-port-border overflow-hidden">+ <div className="inline-flex max-w-full rounded-lg border border-port-border overflow-hidden">{MEDIA_FILTERS.map((f) => (<buttonkey={f.id}type="button"onClick={() => onChange(f.id)}aria-pressed={value === f.id}- className={`px-3 py-1 text-xs font-medium transition-colors ${+ className={`min-h-11 px-3 text-xs font-medium transition-colors ${value === f.id? 'bg-port-accent text-white': 'bg-port-card text-gray-400 hover:text-gray-200'@@ -957,15 +957,15 @@ function VideoSearchSection({ installedHfKeys, installingVideoKey, installingVid<p className="text-xs text-gray-500 mb-2">Search all of HuggingFace for LTX-Video / MiniMax H3 LoRAs by name, author, or repository.</p>- <form onSubmit={handleSearch} className="flex flex-wrap gap-2 mb-3">- <div className="inline-flex rounded-lg border border-port-border overflow-hidden">+ <form onSubmit={handleSearch} className="flex flex-wrap items-start gap-2 mb-3">+ <div className="inline-flex max-w-full rounded-lg border border-port-border overflow-hidden">{VIDEO_FAMILY_FILTERS.map((f) => (<buttonkey={f.id}type="button"onClick={() => handleFamilyChange(f.id)}aria-pressed={family === f.id}- className={`px-2.5 py-1.5 text-xs font-medium transition-colors ${+ className={`min-h-11 px-3 text-xs font-medium transition-colors ${family === f.id ? 'bg-port-accent text-white' : 'bg-port-card text-gray-400 hover:text-gray-200'}`}>@@ -973,7 +973,7 @@ function VideoSearchSection({ installedHfKeys, installingVideoKey, installingVid</button>))}</div>- <div className="relative flex-1 min-w-[160px] max-w-md">+ <div className="relative min-w-0 flex-1 basis-40 max-w-md"><Search size={13} className="absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600 pointer-events-none" /><inputtype="text"@@ -981,7 +981,7 @@ function VideoSearchSection({ installedHfKeys, installingVideoKey, installingVidonChange={(e) => setQuery(e.target.value)}placeholder="Search name or repository…"aria-label="Search HuggingFace video LoRAs by name or repository"- className="w-full bg-port-bg border border-port-border rounded pl-8 pr-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"+ className="min-h-11 w-full bg-port-bg border border-port-border rounded pl-8 pr-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"/></div><input@@ -990,12 +990,12 @@ function VideoSearchSection({ installedHfKeys, installingVideoKey, installingVidonChange={(e) => setAuthor(e.target.value)}placeholder="Author (optional)"aria-label="Filter HuggingFace video LoRAs by author"- className="w-32 bg-port-bg border border-port-border rounded px-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"+ className="min-h-11 w-32 max-w-full bg-port-bg border border-port-border rounded px-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"/><buttontype="submit"disabled={loading}- className="bg-port-accent/90 text-white px-3 py-1.5 rounded text-xs font-medium hover:bg-port-accent disabled:opacity-50"+ className="min-h-11 bg-port-accent/90 text-white px-3 rounded text-xs font-medium hover:bg-port-accent disabled:opacity-50">{loading ? 'Searching…' : 'Search'}</button>@@ -1003,7 +1003,7 @@ function VideoSearchSection({ installedHfKeys, installingVideoKey, installingVid<buttontype="button"onClick={clearSearch}- className="px-2 py-1.5 rounded text-xs text-gray-400 hover:text-gray-200 border border-port-border"+ className="min-h-11 px-3 rounded text-xs text-gray-400 hover:text-gray-200 border border-port-border">Clear</button>@@ -1265,8 +1265,8 @@ function SuggestionsSection({ label, hint, cards, alwaysShow = false, runner = n</div>{hint && <p className="text-xs text-gray-500 mb-2">{hint}</p>}{searchable && (- <form onSubmit={handleSearch} className="flex gap-2 mb-3">- <div className="relative flex-1 max-w-md">+ <form onSubmit={handleSearch} className="flex flex-wrap items-start gap-2 mb-3">+ <div className="relative min-w-0 flex-1 basis-40 max-w-md"><Search size={13} className="absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600 pointer-events-none" /><inputtype="text"@@ -1274,13 +1274,13 @@ function SuggestionsSection({ label, hint, cards, alwaysShow = false, runner = nonChange={(e) => setQuery(e.target.value)}placeholder={`Search ${RUNNER_LABEL[runner] || runner} LoRAs on Civitai…`}aria-label={`Search ${RUNNER_LABEL[runner] || runner} LoRAs on Civitai`}- className="w-full bg-port-bg border border-port-border rounded pl-8 pr-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"+ className="min-h-11 w-full bg-port-bg border border-port-border rounded pl-8 pr-3 py-1.5 text-xs text-gray-200 placeholder:text-gray-600"/></div><buttontype="submit"disabled={loading}- className="bg-port-accent/90 text-white px-3 py-1.5 rounded text-xs font-medium hover:bg-port-accent disabled:opacity-50"+ className="min-h-11 bg-port-accent/90 text-white px-3 rounded text-xs font-medium hover:bg-port-accent disabled:opacity-50">{loading ? 'Searching…' : 'Search'}</button>@@ -1288,7 +1288,7 @@ function SuggestionsSection({ label, hint, cards, alwaysShow = false, runner = n<buttontype="button"onClick={clearSearch}- className="px-2 py-1.5 rounded text-xs text-gray-400 hover:text-gray-200 border border-port-border"+ className="min-h-11 px-3 rounded text-xs text-gray-400 hover:text-gray-200 border border-port-border"title="Clear search — back to top ranking">Clear