Merge branch 'claude/relaxed-faraday-h4zd09' of https://github.com/pablovolenski/vienalatina
This commit is contained in:
commit
c3a7d8fb89
@ -180,8 +180,22 @@ label { display: block; margin: 1rem 0 0.35rem; font-weight: 600; font-size: 0.9
|
|||||||
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
|
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
|
||||||
label.check input { margin: 0; }
|
label.check input { margin: 0; }
|
||||||
|
|
||||||
input[type="text"], input[type="email"], input[type="date"],
|
/* Everything a person types in, named by what it is NOT.
|
||||||
input:not([type]), select, textarea {
|
*
|
||||||
|
* This was a list — text, email, date and inputs with no type at all — and a
|
||||||
|
* list of accepted types is wrong the moment somebody adds one. It was: the
|
||||||
|
* password box on the sign-in page was a browser default sitting under a
|
||||||
|
* full-width username box, because `password` was never added, and so was the
|
||||||
|
* number box for a page's order. Nothing errors; the form just looks unfinished
|
||||||
|
* in a way only a person looking at it can catch.
|
||||||
|
*
|
||||||
|
* The controls below are excluded because they are not text boxes and would be
|
||||||
|
* disfigured by this: a checkbox, a radio, a file picker (styled separately),
|
||||||
|
* and the button-like types. Anything else — password, number, url, search,
|
||||||
|
* tel, whatever arrives next — is a field somebody types in and gets the same
|
||||||
|
* box without this rule having to be edited again. */
|
||||||
|
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
|
||||||
|
select, textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.6rem 0.75rem;
|
padding: 0.6rem 0.75rem;
|
||||||
border: 1px solid var(--border-light);
|
border: 1px solid var(--border-light);
|
||||||
@ -189,7 +203,7 @@ input:not([type]), select, textarea {
|
|||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
input[type="checkbox"] { width: auto; }
|
input[type="checkbox"], input[type="radio"] { width: auto; }
|
||||||
textarea { resize: vertical; line-height: 1.55; }
|
textarea { resize: vertical; line-height: 1.55; }
|
||||||
|
|
||||||
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
|
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
|
||||||
|
|||||||
@ -174,3 +174,36 @@ def test_the_fields_that_are_not_prose_stay_plain():
|
|||||||
html = (Path(__file__).resolve().parents[1] / "templates" / name).read_text(encoding="utf-8")
|
html = (Path(__file__).resolve().parents[1] / "templates" / name).read_text(encoding="utf-8")
|
||||||
opening = re.search(rf'<textarea id="{box}"[^>]*>', html)
|
opening = re.search(rf'<textarea id="{box}"[^>]*>', html)
|
||||||
assert opening and "data-markdown" not in opening.group(0), name
|
assert opening and "data-markdown" not in opening.group(0), name
|
||||||
|
|
||||||
|
|
||||||
|
# --- the form controls are named by what they are not ---------------------
|
||||||
|
|
||||||
|
UNSTYLED_ON_PURPOSE = {"checkbox", "radio", "file", "submit",
|
||||||
|
"button", "reset", "image", "hidden"}
|
||||||
|
|
||||||
|
|
||||||
|
def test_the_form_rule_is_an_exclusion_and_not_a_list_of_accepted_types():
|
||||||
|
"""It used to be `input[type=text], input[type=email], input[type=date],
|
||||||
|
input:not([type])` — an allowlist, which is wrong the moment anybody adds a
|
||||||
|
field. It was: the password box on the sign-in page was a browser default
|
||||||
|
sitting under a full-width username box, and the number box for a page's
|
||||||
|
order was the same. Nothing errors; the form just looks unfinished, which
|
||||||
|
only a person looking at it can catch.
|
||||||
|
|
||||||
|
So the guard is on the shape of the rule rather than on any one type: it has
|
||||||
|
to exclude the controls that are not text boxes and style everything else.
|
||||||
|
"""
|
||||||
|
css = (Path(__file__).resolve().parents[1] / "static" / "board.css").read_text(encoding="utf-8")
|
||||||
|
selector = [line for line in css.splitlines() if line.startswith("input:not(")]
|
||||||
|
assert selector, (
|
||||||
|
"board.css has no `input:not(...)` form rule. If it is back to listing "
|
||||||
|
"accepted types, the next field somebody adds will be unstyled."
|
||||||
|
)
|
||||||
|
excluded = set(re.findall(r'\[type="([a-z]+)"\]', selector[0]))
|
||||||
|
assert excluded == UNSTYLED_ON_PURPOSE, (
|
||||||
|
f"the stylesheet excludes {sorted(excluded)}; expected "
|
||||||
|
f"{sorted(UNSTYLED_ON_PURPOSE)}. Anything a person types in belongs in "
|
||||||
|
"the rule, not outside it."
|
||||||
|
)
|
||||||
|
for typed_in in ("password", "number", "email", "date", "text", "search", "url"):
|
||||||
|
assert typed_in not in excluded, f"{typed_in} is a box somebody types in"
|
||||||
|
|||||||
@ -415,16 +415,38 @@ finds Gitea level with your local `main`, and answers *"Already up to date."*
|
|||||||
which is true about the wrong remote, and reads exactly like there is nothing
|
which is true about the wrong remote, and reads exactly like there is nothing
|
||||||
to do.
|
to do.
|
||||||
|
|
||||||
An update is a named pull, a push to Gitea so the build pipeline sees it, and a
|
**Paste one line at a time.** Every deploy that has gone wrong here went wrong
|
||||||
rebuild:
|
in the terminal rather than in the code: three commands pasted on one line
|
||||||
|
separated by commas, so git looked for a branch whose name ended in a comma; and
|
||||||
|
a block pasted into a session that was still answering `ssh`'s host-key
|
||||||
|
question, which swallowed the rest as answers. One line, one Enter, read what it
|
||||||
|
says.
|
||||||
|
|
||||||
|
An update is **two** named pulls, a push to Gitea so the build pipeline sees it,
|
||||||
|
and a rebuild:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd ~/vienalatina
|
cd ~/vienalatina
|
||||||
git pull --no-rebase --no-edit github <the-branch-name>
|
git pull --no-rebase --no-edit github <the-branch-name>
|
||||||
git push gitea main
|
git pull --no-rebase --no-edit gitea main # see below — Gitea moves on its own
|
||||||
sudo bash scripts/deploy-board.sh
|
sudo bash scripts/deploy-board.sh
|
||||||
|
git push gitea main
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**The second pull is the one this page used to be missing**, and the push fails
|
||||||
|
without it with a non-fast-forward rejection. The translate step of the pipeline
|
||||||
|
*commits* the generated German and Portuguese files back to Gitea
|
||||||
|
(`translate: update N generated siblings [skip-translate]`), so every time
|
||||||
|
anything is published, `gitea/main` gains a commit this checkout does not have.
|
||||||
|
A push then has nothing to fast-forward from. Pulling it first merges the
|
||||||
|
pipeline's own work into yours, which is all that is needed — there is never a
|
||||||
|
conflict, because nothing but the pipeline writes those files.
|
||||||
|
|
||||||
|
**The order of the last two lines matters when a release changes both halves.**
|
||||||
|
`deploy-board.sh` puts the members area up; the push is what rebuilds the public
|
||||||
|
site. Anything on the static side that calls the app — the members' bar asking
|
||||||
|
`/comunidad/sesion.json` — then finds it already there.
|
||||||
|
|
||||||
Both flags earn their place. `main` and the branch have genuinely diverged —
|
Both flags earn their place. `main` and the branch have genuinely diverged —
|
||||||
main carries the previous merge, the branch carries the new work — and a git
|
main carries the previous merge, the branch carries the new work — and a git
|
||||||
with no `pull.rebase` set refuses to guess, with *"fatal: Need to specify how to
|
with no `pull.rebase` set refuses to guess, with *"fatal: Need to specify how to
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user