forge
Clone
0 watching0 forksRustAGPL-3.07.1 MiBc8ea10cTahinli27 days ago292 commits
Forge page language
Every page follows this, with no exceptions. The look lives in one place, style/_one.scss, the parts
in crates/forge-web/src/views/parts.rs. A page writes structure and classes only: no page has its
own button, field, menu, tab, tag or box. If something does not fit, change the part, never the page.
scripts/audit/measure.ts reads the computed look of every control on every page and reports anything
outside this language.
A page
main holds these and nothing else, in this order:
- Head:
<section class="head">, written withhead(title: .., sub: .., <actions>)or, in a repo,repo_head(head: header, title: .., sub: .., <actions>). One visibleh1. What the page is and what you can do about it sit together: the actions come right after the title, never at the far end. - Tabs:
<nav class="tabs">, the sections of the area you are in. Settings and admin get theirs from the shell, and a page's head goes above them by itself. A repo's are insiderepo_head. - Strip (
.strip): only CI steps and files under review. It shows the whole thing and is how you move through it. Never on repo or settings pages. - Work: one
.sheet, or.workwhen the page has a list to pick from:<div class="work"> rail(..) <div class="sheet">..</div> </div>.
Also allowed in main: .state and .alert for a message about the whole page.
No visible title is ever missing, and no h1 class="sr-only". No page sets a width: the sheet takes the
room. A page without a sub-list has no rail.
The rail
rail(label: .., items: vec![RailItem { name, val, href, current }]). It holds one list, never two. A
long list scrolls by itself, with a filter input above it. One folder at a time; the path bar goes up.
Sections never go in the rail: they go in .tabs.
The sheet
<div class="sheet">, white, radius 16, hairline ring. Add fit for a sheet that should hug its content.
<div class="sheet-tools"><strong>Name</strong> <a class="act">Tool</a> ...</div>: 48px row, the name of what is showing and its quiet tools right after it.<section class="sec"><h2>Topic</h2> ... </section>: one topic. Hairline between topics.- A list: rows, with no heading if the tools row names it.
- The sheet holds the content. Nothing nests a box in a box: no
.card,.rows-pane,.fit-pane,.row-line,.row-field,.page-head, sidebars or second columns.
Rows
<a class="line" data-kb-row=""><span class="name">..</span><span class="val">..</span></a> when the item
has its own page. Otherwise the row shows everything at once: its facts in the one .val, joined with
" · ", and its actions right after them on the same line. A confirm opens in place of its word, on the row.
<div class="line">
<span class="name">laptop</span><span class="val">SHA256:9fK2c1Qx · added 3 days ago</span>
confirm_act(..Delete..)
</div>
<details class="row-open"> only for a row whose hidden part is an edit form (a rename, a role). Never a
row that opens to show facts or a single action, never a link to a page that shows the same row again:
one click to see, one to act.
Details come right after the title on one line. Nothing is pushed to the far end of a row:
no margin-left:auto, no justify-content:space-between, no second column at the right.
Actions
- Button:
<button>(soft),<button class="primary">(filled),.small. A head holds the page's main action as.primaryand its others as soft. A form's submit is.primary, once, under its fields.a.buttonfor a link that acts like one. Every action beside a title is that soft pill (or the filled one), whatever it is made of: ana.act, a form'sbutton.actor a reveal'ssummary.actin the head takes the pill's look, so no head shows a bare word beside a button. On a tabbed page the head's action follows the tab: a profile shows Edit profile on Overview, New repository on Repositories, New snippet on Snippets and New organization on Organizations, and the list itself carries no second "New ..." line under it. - Facts: a page that describes one thing (an account, an organization) lists it as
.sec.facts: compact 34px lines of a.keyon the label column, the.val, and the action for that fact on the same line. No hints stacked under a heading: what a fact means or why its action is missing goes in its value. - Time range: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools row starts with the count of entries that match, so "how many sign-ins last week" is one glance.
- Tool:
.act, a word in the accent's ink (14px, 600, radius 12), never the dim colour of a hint. A topic's own action, standing alone under its heading in.sec > .actsor right in the.sec(Rename repository, Transfer repository), takes the small soft pill (32px, like Star) instead, red-worded when dangerous. On a line of facts a tool stays a word..act.dangerfor destructive. This is what goes in tools rows, in rows and in.acts. reveal(label, id, open): a tool that opens its form in place.openwhen a form came back with an error. In a.fieldsform its word starts on the controls' edge. What should not be one click away (regenerating recovery codes, turning off two-factor) is a reveal whose form asks for the password and the code again, never a prominent button.confirm_act(lang, label, action, csrf, fields, note): every destructive action. It always asks first, in place, with a small filled danger button and "Keep it". There are no one-click deletes.post_act(label, action, csrf, fields): a tool that posts at once, for what loses nothing.- No optimistic UI. Show done only after the server said so.
Forms
<form class="fields">
<div class="field"><label for="x">Name</label><input id="x"><p class="hint">One line.</p></div>
<button type="submit" class="primary">Save</button>
</form>
The label sits beside its control in one column, the hint after the control. .field-pair for two short
fields. A checkbox is <label class="switch"><input type="checkbox"><span>..</span></label>, the box right
before its label. Few fixed options are .choice:
<div class="choice"><label><input type="radio" name="theme" value="auto" checked><span>Auto</span></label> ..</div>
Longer lists are a <select>, 280px like a line of text with its chevron at its end, so every control in a
form ends on one edge. Fields are soft filled shapes with no line around them. Every control has a
label. Errors are alert at the top of the form they belong to, which stays open with the user's text.
Lists and search
Every list that can grow has a search, and every search is finder_field (views/find.rs): a live
.plain-search (results follow typing, no Enter) with two options beside it, Exact and Aa (match case),
which apply the moment they are ticked. By default a search forgives typos and case. Its placeholder
names what is searched ("Search users", "Search organizations", not one text for every tab). A category
filter is a .find-filter: its word, then the small soft select, on the same line. Inside a topic the
row is form.sec-tools.
A list that can grow is paged, never endless: about one screen of rows. Pagers appear only when another
page exists, as one nav.pager row under the list on the sheet's inset. A numbered pager always has
Previous and Next and always seven page slots once there are more than seven pages, so nothing in the
row moves when you change page; a step you cannot take stays in place, dimmed. An empty list is
.state with one line and its action as .act. A log reads as text: action words, then facts joined
with " · ", never raw JSON. Runs of the same action by the same person fold into one details.log-group
line with "×N" and what they share; the line opens in place to list every entry with what differs, and
a page counts folded lines, so a page of folds is as full as any other.
Menus
Every dropdown, menu, popover and hover panel is the same panel: .menu-list, .pop-panel or
.row-menu-panel, radius 20, shadow and ring, rows 34px high. Instant, no animation. No browser
triangles. It never leaves the window, on a phone either.
Colour
Tokens only: --bg, --surface, --surface-2, --text, --muted, --border, --border-strong, --accent,
--accent-soft, --bad, --danger-bg, --add-bg, --del-bg. Accent marks the one live or selected
thing. In CI, running is the accent, passed is --ok green and failed is --bad, everywhere a result
shows (ticks, step strips, timeline, history bars). --ok takes the accent's lightness and strength
with a green hue, so results sit with whichever accent is chosen. Cancelled is grey, never red. Added
is blue and deleted is rose.
A colour choice offers five presets and a Custom chip (its swatch and the word), on the same columns in every row. Backgrounds and accents of one hue share a column: Ink and Sage (the default for light and dark), Anvil and Ember, Dusk and Ocean, Heather and Plum, Blush and Rose.
Type
Figtree for words, IBM Plex Mono for hashes, numbers beside names, paths and logs. No uppercase, no
letter-spacing, no Archivo. h1 26/34 bold; h2 13 semibold dim; body 15/22; tools 14; hints 13.
Words
Short, plain, sentence case, no em dashes. All text goes through i18n, or
crate::pages::passkeys::s(lang, "English", "Türkçe"), in proper Turkish ("çevrim içi" is two words). A
Turkish page shows no English, an English page no Turkish.
Rules that stayed
- No page transitions, no decorative motion. Live arrivals only, off for reduced motion.
- CSP is strict: no inline style attributes, no inline script.
- List rows carry
data-kb-row. Live pages keepdata-live,data-arriveand every data attribute nav.js reads. - Signed-in preferences live in the database.
- A setting must visibly change something, or it goes.
- A phone (390px) is one column: no sideways scroll, tabs scroll inside their row.
- Pages fit one screen where they can: use tabs and the rail, not stacked unrelated topics.
Fixed places
- Every head on a page with tabs is one height (a 38px title line and one sub line), so the tabs and the sheet never move when you switch tabs.
- The path bar names every place above the page as a link: section, item (
#12), page. A page whose parent is not in its address (a job's run) passes it toshell(parents: ..). No page needs the browser's Back button. - A form of one field puts its submit beside the field.
- Every control has one focus ring: 2px in
--focus, inside its own edge (outline-offset: -2px), so no sheet, row or scrolling list cuts it. - A tab's own pages sit in its rail: the Security log is a Security rail item, not a page of its own.
- No page is an orphan. A page that makes or shows something of yours (a new repository, an import, a snippet, a new organization) shows your profile tabs with the area it belongs to marked, and the inbox pages (Notifications, Needs you, Review requests) share one rail, so a mouse reaches every neighbour.
- An action a server cannot carry out shows as unavailable: no "send again" when mail is not set up.
- Avatars without an uploaded image are drawn in the page (a letter on a colour from the name), so a list of people or organizations never waits on image requests.