You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[scanner] π [v5] Knowledge: inline required-field errors for Add Git Source / Add Sub / Import formsΒ #17587
On the dashboard Knowledge panel, "Add Git Source" β Clone & Index with an empty Display name (or URL) appears to do nothing. kbAddGitSource (src/pkg/dashboard/static-src/js/knowledge.js) does validate, but hiveAlert (tooltips-dialogs.js) routes short messages to a transient info toast far from the form, so the failure reads as "nothing happened". Same pattern in kbAddSub ("URL is required") and the hub-side Import form.
Fix
Add a small shared helper in knowledge.js that marks the offending <input> with a .field-invalid class (red border) and aria-invalid="true", focuses it, and renders the message in a <div class="field-error" role="alert"> directly under the input. Clear the state on input.
If a toast is kept, use showToast(msg, 'error') (sticky) rather than info.
Mark required inputs (required attribute + label/placeholder marker).
Apply to kbAddGitSource, kbAddSub, and the hub-side Import form.
Tests: JS validation helper test if a harness exists for knowledge.js; rebuild static/index.html from the manifest if that is how this repo ships static-src.
Acceptance
Clicking Clone & Index with an empty required field highlights the field, focuses it, and shows the message under it.
Decision taken by hive: #17583 is split into two children because inline validation (JS/CSS only) and the edit endpoint (server + UI) are independent concerns; this one lands first since both touch knowledge.js.
Activity