fix(images): cap the search at the listing API's 500 characters

A longer paste was sent as is, the API rejected it and the collection
showed "Images could not be loaded". The legacy search capped it.
This commit is contained in:
Vito Sansevero
2026-10-20 11:09:42 -07:00
parent b6d765f11e
commit b56981e269
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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');
+2
View File
@@ -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);