Files
Skald-Circle/web/css/page-shell.css
T
Daniele 488c702517
Nightly Build / build (push) Successful in 5m36s
feat(files): a Files section over the caller's whole space
Until now file browsing existed only inside a project, and the two memory
stores were reachable only by the agent's tools. `#files` is the general
surface: home, both memory stores, the shared folders and projects the
caller belongs to, plus the read-only skills and docs trees.

The root is virtual, and that is the design. Anchoring at `~` is wrong:
the explorer reads host-side, while `shared/`, `projects/`, `skills/` and
`docs/` are bind mounts inside the container — a page rooted at the home
would show less than the user has with no way to reach the rest, and on
native Linux would show Docker's empty mountpoint stubs, a door that
appears to work and leads nowhere. So level 0 is a synthetic list from the
new `GET /api/files/roots`, serialized from the caller's `UserFs` plus the
two virtual memory roots. It sends `kind`, never a label: labels are copy
and get translated.

`GET /api/files/dir` now answers `{ path, can_write, entries }`, and a
memory path is classified before `resolve_view_path` (which refuses one)
and listed from `memory_docs`: one level derived from the flat key space
by the pure `memory_docs::immediate_children`, over a single query whose
unslashed prefix also spots an exact note as "not a directory". Memory is
read-only from the page — every writer routes through `resolve_view_path`,
and `shared-memory/*` is `@fs_write require` for the agent, so a button
that walks past that rule is a decision of its own.

The explorer moves out of projects into `shared/file-explorer.js`, taking
`root` + `rootLabel` and reading `can_write` from the listing rather than
from its host: writability changes per branch and comes from the same
`UserFs::can_write_to` the server rejects writes with, so the buttons
offered and the writes accepted cannot disagree. Deep-linking needed it
steerable without a two-way binding, hence `rel` in and
`explorer-navigate` out — the event fires only for a click, never for a
`rel` the host set, so echoing it back is a no-op.

The URL carries the agent path of the open folder in one parameter, the
same vocabulary the assistant uses, so a link is shareable and pasteable
into a conversation; which root it belongs to is derived, not stored.

docs/: a new files.md, plus two pages this made false — shared-folders.md
claimed in three places that a shared folder has no explorer, and
memory.md never said a user can now read their own notes.
2026-08-22 20:09:56 +01:00

118 lines
2.6 KiB
CSS

/* ── Custom element display + layout shell ──────────────────────────────────── */
tasks-page {
display: none; /* toggled by JS */
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
border-right: 1px solid var(--toolbar-border, #e5e9f0);
}
task-running-section,
task-cron-jobs-section,
task-scheduled-section,
task-history-section {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
min-width: 0;
}
llm-providers-page,
models-hub-page {
display: none; /* toggled by JS */
flex: 1;
min-width: 0;
overflow-y: auto;
border-right: 1px solid var(--toolbar-border, #e5e9f0);
}
models-llm-section,
models-transcribe-section,
models-image-section {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
min-width: 0;
}
projects-page {
display: none; /* toggled by JS */
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
border-right: 1px solid var(--toolbar-border, #e5e9f0);
}
project-list-section,
project-board-section {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
min-width: 0;
}
session-detail-page,
system-agents-page,
file-viewer-page,
tool-detail-page {
display: none; /* toggled by JS */
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
border-right: 1px solid var(--toolbar-border, #e5e9f0);
}
users-page,
roles-page,
shared-folders-page,
files-page,
connectors-page,
connector-detail-page,
plugin-catalog-page,
plugin-detail-page,
plugin-page-host,
marketplace-page,
profile-page {
display: none; /* toggled by JS */
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
border-right: 1px solid var(--toolbar-border, #e5e9f0);
}
/* Plugin-contributed page fragments mount inside the host with the `plugin-id`
attribute set — make them fill the host column (the host is `flex:1`, but a
bare custom element has no default sizing). Generic across all plugins. */
plugin-page-host > [plugin-id] {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
}
/* ── Workspace placeholder ──────────────────────────────────────────────────── */
.app-workspace {
display: flex;
flex: 1;
min-width: 0;
align-items: center;
justify-content: center;
color: var(--placeholder-color, #94a3b8);
font-size: 0.9rem;
}