diff --git a/tests/js/workspace-toolbar.test.js b/tests/js/workspace-toolbar.test.js index 7085dda..db2818e 100644 --- a/tests/js/workspace-toolbar.test.js +++ b/tests/js/workspace-toolbar.test.js @@ -138,6 +138,8 @@ test('toolbar emits concept markup and order', async () => { assert.equal(input.id, 'search'); assert.equal(input.type, 'search'); assert.equal(input.placeholder, 'Search prompts, tags, filenames…'); + // The listing API rejects search text over 500 characters, as the legacy search capped it. + assert.equal(input.maxLength, 500); assert.equal(input.getAttribute('aria-label'), 'Search workspace'); assert.equal(input.value, 'castle'); diff --git a/web/js/workspace/toolbar.mjs b/web/js/workspace/toolbar.mjs index d1cd2b5..2eac2e7 100644 --- a/web/js/workspace/toolbar.mjs +++ b/web/js/workspace/toolbar.mjs @@ -68,6 +68,8 @@ export function mountToolbar(container, { scope, categories = [], sorts, value = search.id = 'search'; search.type = 'search'; search.placeholder = 'Search prompts, tags, filenames…'; + // The listing API rejects longer search text (py/api/images.py _workspace_filters). + search.maxLength = 500; search.setAttribute('aria-label', 'Search workspace'); label.append(createWorkspaceIcon('search'), search);