oficina / memoria Public

Clone
git clone https://amadan.net/oficina/memoria

Plain git — no account needed to clone.

Download

Download this file

1{{define "layout"}}{{$L := localizer $}}<!doctype html>
2{{/* layout — every page's document: the head, the estilo bar, <main>
3 and the footer.
4
5 The bar is estilo's (chrome.Bar, built once per request in
6 chrome.go), in place of the hand-made rst-page-header nav, which
7 wrapped onto two rows at 1440px (97px) with its open Help panel over
8 the Sources and Sign out buttons. estilo's is 52px at every width,
9 signed in or out, with the account always last in the same corner.
10
11 data-theme is written into the first bytes of the response, from the
12 Appearance cookie read server-side (chrome.Appearance), so there is
13 no flash. It is ABSENT for "system", and that is the mechanism:
14 theme.css's toggle is :root[data-theme="light"|"dark"], and with no
15 attribute the browser follows the operating system.
16
17 The <title> is built here and only here, "{part} · {part} · Memoria",
18 so no handler can drift from the suite's separator (spec §10). It
19 used to be written per page, and they said "—" and "·" by turns. The
20 one exception is the sign-in door, whose whole title is rastrillo's
21 for its state ("Sign in to Memoria"; Frame.WholeTitle).
22
23 <meta charset> comes first, before anything that could be read as
24 text. The stylesheets are in the suite's fixed order: tokens, theme,
25 brand, then estilo's base, menu and chrome (and the door's sky), then
26 memoria.css, then the page's own (head). */}}
27<html lang="en"{{with .Frame.Theme}} data-theme="{{.}}"{{end}}>
28<head>
29<meta charset="utf-8">
30<meta name="viewport" content="width=device-width, initial-scale=1">
31<title>{{with .Frame.WholeTitle}}{{.}}{{else}}{{range .Frame.TitleParts}}{{.}} · {{end}}{{.Frame.Chrome.App.Name}}{{end}}</title>
32<link rel="icon" type="image/png" sizes="32x32" href="{{asset "static/brand/icon-32.png"}}">
33<link rel="icon" type="image/svg+xml" href="{{asset "static/brand/icon.svg"}}">
34<link rel="apple-touch-icon" sizes="180x180" href="{{asset "static/brand/apple-touch-icon.png"}}">
35<link rel="stylesheet" href="{{asset "static/tokens.css"}}">
36<link rel="stylesheet" href="{{asset "static/busy.css"}}">
37{{/* theme.css carries the palette. tokens.css only USES --rst-bg and
38 friends — it defines eleven tokens, none of them colours — so
39 without this link every colour resolves to initial and whole
40 shorthand declarations become invalid at computed-value time. The
41 rastrillo scaffold's layout omits it, which is a scaffold bug, not
42 a choice: the page does not go grey, individual rules vanish. */}}
43<link rel="stylesheet" href="{{asset "static/theme.css"}}">
44<link rel="stylesheet" href="{{asset "static/brand/brand.css"}}">
45<link rel="stylesheet" href="{{asset "static/base.css"}}">
46<link rel="stylesheet" href="{{asset "static/menu.css"}}">
47<link rel="stylesheet" href="{{asset "static/chrome.css"}}">
48<link rel="stylesheet" href="{{asset "static/sky.css"}}">
49<link rel="stylesheet" href="{{asset "static/memoria.css"}}">
50<script defer src="{{asset "static/rastrillo.js"}}"></script>
51<script defer src="{{asset "static/busy.js"}}"></script>
52{{/* chrome.js closes an open bar panel on Escape or an outside click.
53 Nothing depends on it. */}}
54<script defer src="{{asset "static/chrome.js"}}"></script>
55{{/* drop.js is inert on every page but the one carrying [rst-dropzone]:
56 it looks for the zone first and returns if there is none. It is
57 linked here rather than in index.html because the layout is where
58 scripts are linked, and it costs a querySelector to load it twice. */}}
59<script defer src="{{asset "static/drop.js"}}"></script>
60{{/* search.js is the same bargain, keyed on [rst-search]. It shares the
61 results region with drop.js and does not assume it owns it. */}}
62<script defer src="{{asset "static/search.js"}}"></script>
63{{iconAssets}}
64{{block "head" .}}{{end}}
65</head>
66<body>
67{{/* [estilo-shell] has no styling of its own; it is the wrapper a
68 full-height page would key its layout on. */}}
69<div estilo-shell>
70<a rst-skip href="#main">{{.Frame.Chrome.Labels.Skip}}</a>
71{{template "estilo-bar" (withL (.Frame.Chrome) $L)}}
72<main rst-page rst-stack id="main">
73{{template "content" .}}
74</main>
75{{/* The footer is said only to somebody signed in: its count and its
76 egress claim are statements about searching (spec §9.2 retires the
77 claim from the sign-in page), and a visitor who cannot search has
78 nothing they are true or false about. */}}
79{{if .Frame.Signed}}{{block "footer" .}}<footer rst-page-footer>
80 {{/* An upload that never navigates cannot change the passage count,
81 so it carries rst-refresh and drop.js swaps it out of a re-fetch
82 of the page. On /add it is the only region that does. drop.js
83 aborts the whole swap if a named region is missing from the
84 answer, so the span is on every signed-in page.
85 The span wraps ONLY the count: the egress claim beside it is not
86 derived from anything and has no business travelling with it.
87
88 Both branches are inside the span, deliberately. Chunks is -1 when
89 the count could not be read at all, and the sentence for that is
90 the one thing here that must survive a refresh: a region that
91 carried only the number would refresh a failure into a confident
92 zero, which is the failure shape this app has already had once. */}}
93 {{/* One quiet line (Paul, 2026-10-30: "We don't really need the cruft
94 around it"), and the whole egress statement one click away in a
95 <details>, so it is still on every page, still in the markup the
96 footer gates read, and works without a script. The summary itself
97 names whether anything leaves. */}}
98 <details rst-foot-details>
99 <summary rst-muted>{{if .ModelOn}}🤖 AI is on · what is sent{{else}}No document leaves this instance{{end}}</summary>
100 <p rst-muted>
101 <span rst-refresh="passages">{{if lt .Chunks 0}}The passage count is unavailable.{{else}}{{.Chunks}} passage{{if ne .Chunks 1}}s{{end}} indexed.{{end}}</span>
102 {{/* The egress claim, and it depends on the model switch (§8.9). With
103 AI off the strong sentence is true and is stated. With AI on it is
104 FALSE: a search that asks for a postal address sends up to eight
105 passages to TensorX. The first build left the strong sentence on
106 every page while that happened; a review sent a passage and got
107 this footer back in the same response. */}}
108 {{if .ModelOn}}Search is lexical. <strong>AI is on:</strong> when you
109 search, a search with no checked answer sends up to eight of its
110 passages and your query to TensorX for an AI answer, and a search for
111 a postal address sends up to eight passages to find it. Suggestions
112 while you type send nothing. No other document leaves this instance.
113 {{else}}Search is lexical only — no assistant, and <strong>no document ever
114 leaves this instance</strong>.{{end}}
115 </p>
116 </details>
117</footer>{{end}}{{end}}
118</div>
119</body>
120</html>
121{{end}}
122