Knowledge bases, and a file input that lines up
**Bases.** Documents now live in named collections rather than one flat pile, and a chat can be pointed at particular ones — "answer from the contracts folder" is a different question from "answer from everything I have ever uploaded". A chat with none attached still searches everything its owner can see, because empty means unscoped, not empty. The harness names the attached bases. Without that the model cannot tell "there is nothing about this" from "I am only allowed to see one folder", and it phrases a miss as the former. **Sharing moves to the base.** A document is visible to whoever can see the base it lives in, so `Document` is gone from the shareable types and `documents.visible()` filters through `base_id`. "This folder is the team's" is the granularity people think in; per-document grants meant answering "who can see this?" by checking every file. Moving a document between bases changes who can see it, so the destination has to be one you own. `Document.base_id` is nullable only because the column had to be added to a table that already had rows. `sweep_unfiled()` runs at startup beside the orphaned-upload sweep and files anything predating bases into its owner's default, which is what makes "always set" true everywhere else. **The file input.** `.input` gave it a fixed height and horizontal padding, so the browser's own button sat hard against the left edge while the filename floated off the centre line. A file input is two controls in one box and neither inherits anything useful, so it gets its own rule: no horizontal padding, the button sized to `--control-h` with the divider that separates it, and the text centred with line-height rather than flexbox, which file inputs do not lay out reliably. 437 tests, ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,6 +231,43 @@ button, input, textarea, select {
|
||||
box-shadow: 0 0 0 3px var(--accent-soft);
|
||||
}
|
||||
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
|
||||
|
||||
/*
|
||||
File inputs.
|
||||
|
||||
A file input is two things in one box -- a button the browser draws and the
|
||||
chosen filename beside it -- and neither inherits anything useful. Left alone
|
||||
with `.input`, the padding applies to the whole control so the button sits
|
||||
hard against the left edge while the text floats off its centre line.
|
||||
|
||||
So: no horizontal padding on the control, the button styled to the same
|
||||
height as everything else and given the right border that separates it, and
|
||||
the filename centred with line-height rather than flexbox, which file inputs
|
||||
do not lay out reliably.
|
||||
*/
|
||||
.input[type="file"] {
|
||||
padding: 0 var(--control-px) 0 0;
|
||||
line-height: calc(var(--control-h) - 2px);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
.input[type="file"]::file-selector-button {
|
||||
height: calc(var(--control-h) - 2px);
|
||||
margin: 0 var(--sp-3) 0 0;
|
||||
padding: 0 var(--control-px);
|
||||
border: 0;
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--surface-hover);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
.input[type="file"]:hover::file-selector-button { background: var(--surface-active); }
|
||||
.input--mono, .textarea--mono { font-family: var(--font-mono); font-size: var(--text-xs); }
|
||||
|
||||
.select {
|
||||
|
||||
Reference in New Issue
Block a user