3e610ac5d2
5 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ff115c1d6b
|
A post can say that a machine wrote it
A switch beside the button that publishes — on the editor, on a member's proposal and on a wall thread — and a pill next to the date wherever the post is read: the article, the cards in the listings, the thread, the wall's list, and the moderator's review screen. Next to the date rather than under the text, because a disclosure somebody meets after reading the thing is not a disclosure. Where it lives follows what the thing is. A public post carries `ai_generated: true` in its own frontmatter, written only when true — the file in the repository is the record, and `ai_generated: false` on every post ever written is noise in git and a question in the mind of whoever reads one. A thread carries a column. A proposal carries a column too, and that is the one place it has to be moved by hand: a proposal is a draft in SQLite until it is approved, so the frontmatter it will end up in does not exist while the decision is being made, and losing it there would lose it exactly when the text stops being private. `content.edit` loads the flag back into the form, for the same reason the byline is carried through: a field read but not written back is a field that one corrected typo silently removes. The pipeline needs nothing. translate.py copies the whole frontmatter and rewrites only TRANSLATED_KEYS, so the flag reaches the German and Portuguese siblings by itself — right rather than lucky, since a translated post was still machine-written. Asserted against the real list, so a key quietly added to it fails the suite. Migration 9: three plain ADD COLUMNs, tested against a database with a thread, a proposal and a cached post already in it. The three words are in partials/t.html with the theme's other labels. This is also the shape the EU AI Act's Article 50 asks for, which is worth knowing for whoever installs this for a second organisation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |
||
|
|
59b595170f
|
A calendar a phone can read, and tap targets a thumb can hit
The private calendar rendered as six hundred pixels of nothing on a phone.
The cause was two adjacent rules in board.css with opposite outcomes:
.cal, .cal tbody, .cal tr, .cal td { display: block } /* (0,1,1) */
.cal__pad { display: none } /* (0,1,0) */
.cal__day:not(:has(.cal__event)) { display: none } /* (0,2,0) */
`.cal td` outranks `.cal__pad`, so every cell belonging to a neighbouring
month stayed on screen as a 92px empty box; `.cal__day:not(:has(…))`
outranks `.cal td`, so every real day disappeared. A month with no events
drew four blank boxes and nothing else, with correct HTML throughout —
which is why reading the file looked right and no test could see it.
Both calendars are now a column of every day of the month below 640px,
with the weekday beside the number (the column header is hidden there),
the days carrying something standing out, and a line saying so when the
month is empty. The public agenda gets the same shape deliberately: the
private calendar lists the public events, and a member moves between the
two. Every rule that decides `display` now names its cell's own class.
Measured rather than reasoned about, in headless Chromium at 320 and 390
across all 22 members-area screens and the public site in three languages:
- padding cells 0px tall, 31 of 31 days drawn, no horizontal overflow
- the ☰ ran off the right edge of a 320px Portuguese home page, because
«Comunidade» is three letters longer than «Comunidad»; the bar now
gives way at 360px
- the navigation links were 37x17, the calendar's + was 7x15, the footer
links 16px tall. A `pointer: coarse` block in each stylesheet raises
them to 44, padding only, so the desktop is untouched. Links inside a
sentence are left alone, as WCAG exempts them.
Registro de actividad and Contenido stop being a sideways-scrolling table
on a phone and stack one card per row, the two columns that do not
describe themselves labelled from `data-label`.
Guards: three stylesheet tests that compute specificity and run the
cascade for a padding cell, a day cell and the weekday label, in both
stylesheets — each verified by putting the shipped rules back. Plus three
request-level tests: an empty month says so and still draws its 31 days,
a month with events does not claim to be empty, and every day carries the
right weekday.
Members area only to deploy — no migration, no schema change — except the
agenda and the stylesheet, which reach the site through the pipeline.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
|
||
|
c2154b6f06
|
A phone can use this site, and the way in is a button
Your screenshot had no navigation at all: brand, three language letters, posts.
The cause is one missing button, and the CSS has been waiting for it since the
WordPress port. `main.css` hid `.site-bar__pages` below 768px and showed it
again on a class, and styled a `.site-bar__hamburger` — the panel's styles, the
button's styles and the animated ✕ were all ported, and the button itself never
was. Nothing in the theme has ever set that class. So for three phases every
phone saw the site with no menu, with every rule involved correct and every
selector pointing at an element that did not exist.
The toggle is a visually hidden checkbox immediately before the menu, with the ☰
as a `<label>` for it in the bar, and one rule doing the work. No JavaScript.
Not `<details>`, which is this project's usual answer and does not work here: on
desktop the menu has to be open and horizontal, and current Chrome hides a
closed `<details>`'s content with `content-visibility` on `::details-content`,
which a `display` rule on the child no longer overrides. A checkbox behaves the
same in every engine, keeps its place in the tab order and keeps its label.
`test_templates.py` now fails if the stylesheet hides the menu behind a state
the header does not carry — the shape of bug this suite keeps meeting, and the
first time it is guarded rather than found by looking.
**Comunidad is a button in the bar** at every width, brand-coloured through the
tokens Marca writes, instead of a word in a menu that on a phone would not open.
Its three translations moved from the `menus.main` blocks into `t.html`: the URL
is the same in every language, so the menu entry was only carrying a label. The
language switcher is rendered twice, in the bar and at the foot of the panel —
a brand, a button, a ☰ and three language letters do not fit across 360px and
CSS cannot move an element between the two.
**Categories and tags are gone**, both taxonomies. Nothing downstream had to
change: the agenda, the event page, the .ics and the private calendar already
keyed on `event_date` rather than on the category, which I checked before
removing anything. The category was only a gate in the editor, so the gate goes
too — **a post carrying a date is an event**, with nothing to tick first and no
way left to say "this is an event" and then not say when. Migration 6 drops the
two columns that held the terms.
`taxonomies: {}` rather than no `taxonomies` key: leaving the key out restores
Hugo's own defaults, which are tags and categories, so deleting the block built
the very pages it was meant to remove.
Also here, found while looking at the output rather than assumed: the breadcrumb
schema emitted a subpage's parent and the page itself both at position 2, and
the members area's six-section nav had no wrap and no scroll, so `/comunidad/`
on a phone scrolled sideways. It wraps now — two lines showing all six, where a
swipe strip would have left Calendario and Gestión off the edge with nothing to
say they were there.
Verified by rendering: headless Chromium at 320px, 390px and 1280px, before and
after opening the menu, and the members area at 390px. No horizontal overflow at
any of them. 548 tests pass; the build is clean with the pipeline's own flags.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
|
|||
|
|
e52c1e4d49
|
A byline, a way in, and the cell that was not a cell
Three things from a round of looking at the deployed site. **The staggered table rows.** content_list.html had `<td class="actions actions--row">`, and `.actions` is display:flex. A <td> told to be a flex container stops being a table cell: it leaves the row's layout and draws its bottom border at its own content height, so the columns' rules no longer meet. Nothing errors and the page renders, which is how it survived two rounds of somebody looking straight at it — including mine, when I blamed the wrapping on the Miembros table and rebuilt that page as cards. The flex row moves into a <div> inside the cell, and test_templates.py now fails on any <td> carrying the class, beside the guards for the things the CSP silently drops. **A published post did not say who wrote it.** The commit has named the author since the editor was built; the page never did, so a reader could not tell whose article it was. frontmatter_for writes `author`, and `author_url` only when that member has published their own page — a byline linking to a 404 is worse than one that does not link. publish() fills it from whoever wrote the thing, which for an approved proposal is the member and not the moderator; edit() deliberately does not, so fixing a typo in somebody's article never re-signs it. The hidden field carrying the URL back is checked against a path on this site, because a hidden field is a convention and not a promise. scripts/translate.py needed no change, which I checked rather than assumed: it copies the whole frontmatter and translates only the title and description, so an author reaches the German and Portuguese siblings untranslated, as a name should. The theme's single.html renders it, verified by building the site with Hugo 0.135 — `por <a href="/salvador">Salvador Dalí</a>` with the link, `por Salvador Dalí` without. **Contenido had no way in.** The page worked and nothing linked to it: Gestión offered only the static pages, and the Artículos tab exists only once you are already on that screen — so a moderator, who cannot open Gestión at all, had no route to the published articles. Gestión gains an Artículos card, Publicaciones gains *Ya publicado* beside its button, and the button that read "Nuevo página" now reads "Nueva página", since Spanish gives the article a gender and "Nuevo " + the singular cannot be right for both. 439 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |
||
|
|
635372d7a2
|
Write the site from the members area instead of Decap
Decap looks like a different product because it cannot be made to look like this one: its maintainer's answer is override the CSS and accept that class names move between releases, or fork it and carry that forever. Neither is worth building on, so editing moves into the app that already has the site's design and this project's tests. Posts are files in git, so the editor is a form that commits a file through Gitea's contents API. No working copy, no queue, no new state, and no way for the pipeline to tell which editor wrote the file — which is what makes running both at once safe. Decap keeps working; nothing here removes it, and the fallback if something is missing is switching tabs. Filenames and frontmatter are not this module's to invent. They are the contract scripts/translate.py reads: `<basename>.es.md` is what split_lang() parses, the date prefix is what keeps two posts with one title off a single URL, and the absence of `translated_from` is what marks a file as something a person wrote. Several tests import translate.py and run its own parser over what the editor produced, because a file it cannot parse publishes in Spanish and is never translated, with nothing reported anywhere. Commits carry the writer's own Gitea account rather than a bot's, so history says who wrote each post and Gitea's permissions apply unchanged. That needs their access token, which lives in the database and never in a cookie: Flask signs cookies but does not encrypt them, and a token is enough to commit as its owner. Gitea expires tokens after about an hour, so they refresh ahead of expiry and retry once on rejection — without that, saving would start failing partway through an afternoon for no reason the writer could see. Publishing is admin-only. Posting to the internal board and publishing to the public site are different permissions, and the second is the larger grant. Listing caches frontmatter against the git blob sha, because the contents API returns names without bodies: that turns one request per post on every page load into one request in total, and needs no invalidation, since a sha changes only when the file does. Verified: 97 checks. The filename translate.py parses, an authored source that is_generated() rejects, the freeze toggle round-tripping, a stale sha refused with the other edit intact, six filename shapes that must 404 including a generated sibling, plain members refused, an SVG rejected as an image, uploads not colliding, the cache reading each file once and refreshing when it changes, and a preview that renders markdown, escapes script tags and publishes nothing. Smoke-tested live: routes register and gate correctly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |