Skip to content
fossil-skin Artifact [d5f316d02a]
Login

Artifact [d5f316d02a]

Artifact d5f316d02a700a5eb93ed7e7c8143025d5ca011e81ef81e45f66fde6bf1b0464:


# Craft Design Fossil Skin — User's Manual

A practical guide to installing, using, and configuring `fossil-skin` and its optional ticket workbench templates in dark or light mode.

---

## 1. Choosing a Build

Every build in `dist/` is self-contained. It embeds the stylesheet, header, footer, details, logo, favicon, main menu, and `a11y.js` so any Fossil 2.20+ repository can import it with no external assets.

| File | Theme | Font | Approximate size |
|------|-------|------|------------------|
| `dist/craftdesign-skin.cfg` | Dark | Viewer's system UI font | ~323 KB |
| `dist/craftdesign-skin-instrument-sans.cfg` | Dark | Embedded Instrument Sans (WOFF2) | ~415 KB |
| `dist/craftdesign-skin-light.cfg` | Light | Viewer's system UI font | ~321 KB |
| `dist/craftdesign-skin-light-instrument-sans.cfg` | Light | Embedded Instrument Sans (WOFF2) | ~413 KB |

### Why dark and light are separate skins

Fossil computes user, branch, and Pikchr colors on the server using the `white-foreground` setting in the skin's `details` block:

- **Dark builds** set `white-foreground: 1`, so Fossil generates low-saturation dark tints meant for light text.
- **Light builds** set `white-foreground: 0`, so Fossil generates pastel tints meant for dark text.

A CSS-only theme toggle cannot swap those server-generated colors cleanly, so dark and light ship as distinct importable skins generated from the same stylesheet (`skin/css.txt` + `skin/build.py`).

---

## 2. Installing, Switching, and Removing the Skin

### Install on any repository

```sh
fossil config import dist/craftdesign-skin-instrument-sans.cfg -R /path/to/repo.fossil
```

For light mode:

```sh
fossil config import dist/craftdesign-skin-light-instrument-sans.cfg -R /path/to/repo.fossil
```

Changes take effect on the next page load. No server restart is required.

### What `fossil config import` changes

The `.cfg` file sets seven configuration entries:

- `css`, `header`, `footer`, `details` (the skin itself)
- `logo-image`, `logo-mimetype`
- `mainmenu` (Fossil's default menu plus a `Search` link; requires Fossil 2.20+)

It does **not** touch repository content, users, permissions, ticket tables, or ticket templates.

### Switch or revert

- **Switch variants or fonts:** run `fossil config import` with the other `.cfg` file.
- **Revert to a built-in Fossil skin:** open **Admin → Skins** in the web UI and activate any stock skin.

### Recommended per-repo settings

These are repository-level settings that a skin file cannot enable on its own:

```sh
# Enable full-text search so the Search menu link and ticket Full-text button work
fossil fts-config enable check-in wiki ticket forum document -R repo.fossil
fossil fts-config index on -R repo.fossil

# Optional: use a wiki page as the repository home page
fossil config -R repo.fossil set index-page '/wiki?name=index'

# Optional: adjust two users whose hashed chat/timeline colors look too close
# Visit /hash-color-test?rand in Fossil to preview alternate hash words
fossil setting user-color-map "alice alice4 bob bob9" -R repo.fossil
```

---

## 3. Installing the Ticket Workbench Templates (Optional)

The base skin `.cfg` styles Fossil's default ticket pages and saved SQL reports (`/rptview`) automatically. To replace Fossil's default `/reportlist`, `/tktview`, `/tktnew`, and `/tktedit` pages with the full Ticket Workbench, install the four TH1 templates from `skin/tickets/`:

| File | Fossil config key | Page |
|------|-------------------|------|
| `skin/tickets/reportlist.th1` | `ticket-reportlist` | Ticket workbench (`/reportlist`) |
| `skin/tickets/viewpage.th1` | `ticket-viewpage` | Ticket detail, inline edit, history (`/tktview`) |
| `skin/tickets/newpage.th1` | `ticket-newpage` | New ticket form (`/tktnew`) |
| `skin/tickets/editpage.th1` | `ticket-editpage` | Full edit form (`/tktedit`) |

### Single repository

```sh
python3 - <<'PY'
import sqlite3, time
repo = "/path/to/repo.fossil"
con = sqlite3.connect(repo)
now = int(time.time())
for key, fname in (
    ("ticket-reportlist", "skin/tickets/reportlist.th1"),
    ("ticket-viewpage",   "skin/tickets/viewpage.th1"),
    ("ticket-newpage",    "skin/tickets/newpage.th1"),
    ("ticket-editpage",   "skin/tickets/editpage.th1"),
):
    con.execute(
        "INSERT OR REPLACE INTO config(name, value, mtime) VALUES(?, ?, ?)",
        (key, open(fname).read(), now),
    )
con.commit()
con.close()
PY
```

### Multi-repo server (`skin/apply.py`)

`skin/apply.py` applies `skin/tickets/*.th1` to every repository that uses Fossil's default `ticket-table`. Repositories with a custom `ticket-table` (such as mirrored upstream projects) are left untouched unless their sidecar `.meta` file includes `skin-tickets` on line 5.

### Schema auto-detection

The templates require zero schema changes and work cleanly under `vuln-report=fatal`. On each request, `/reportlist` probes whether optional columns exist on `ticket` and adapts automatically:

- **Stock Fossil schema:** shows `Involved`, `Active 30d`, `Pending`, `type`, `priority`, `subsystem`, `status`, `severity`, and List / Table / Board (`status`, `priority`, `subsystem`) / Summary views.
- **Extended schemas with `assignee`:** adds `Mine`, `Unassigned`, the `assignee` facet, `assignee` table column, assignee pills, and `columns: assignee` on the board.
- **Extended schemas with `submitter`:** adds the `Submitted` quick queue, `submitted by me` and `assigned or submitted` in the `role` facet, and `by <submitter>` row attribution.
- **Extended schemas with `closedate`:** highlights `Pending` tickets with `reply waiting` when new activity arrives after `closedate`.

---

## 4. Using the Ticket Workbench (`/reportlist`)

### State tabs and `Deleted` tickets

The top-left control switches between **Open**, **Closed**, and **All**.

- **Open** includes every non-terminal status (`Open`, `Verified`, `Review`, `Pending`, or custom open states).
- **Closed** includes `Fixed`, `Tested`, `Closed`, `Deferred`, and `Rejected`.
- **Deleted** tickets are excluded from **Open**, **Closed**, and **All** by default so spam and removed rows never clutter counts or lists.
  - On **All**, the footer notes how many `Deleted` tickets are hidden with a direct **show** link.
  - You can inspect deleted tickets any time via **status → Deleted (hidden)** (`?st=all&fs=Deleted`).

### Display modes

Switch modes in the top-right segmented control (`list | table | board | summary`):

- **List:** scannable rows with rounded-square state icons (empty box for open, dash for review/pending, checkmark for closed), priority/subsystem/status tags (suppressing any tag shared by 70%+ of matching rows so exceptions stand out), bracketed `[hash]` ID, type, severity, submitter (if present), timestamp, assignee pill, and aligned comment + linked check-in counts.
- **Table:** compact sortable table (`ID`, `Title`, optional `Assignee`, `Status`, `Type`, `Priority`, `Subsystem`, `Updated`). Metadata columns stay on a single line; long assignees or subsystems truncate with an ellipsis and reveal their full text on hover.
- **Board:** Kanban columns grouped by **assignee** (when present), **status**, **priority** (normalized tiers), or **subsystem**.
  - Users with ticket write capability (`w`) can drag cards between columns or use each card's **Move** menu (keyboard accessible, works without JavaScript). Dragging displays a confirmation banner with an **Undo** action.
  - **Closed window on `Open` status boards:** When viewing `Open` tickets grouped by `status`, terminal columns (`Closed`, `Fixed`, `Tested`) stay visible so you can track completed work and drop cards directly into them. A **closed:** popover next to **columns:** controls how much history shows inside terminal columns:
    - `last 14d` (default on unfiltered boards), `last 30d`, `all`, or `drop only`.
    - When you filter by a search query (`q`) or `subsystem`, the default widens automatically to `all` so you see a feature or subsystem's complete set of tickets.
    - Terminal columns always sort newest-closed first and show a footer link (`N older · Show all`) when older closed tickets exist.
- **Summary:** a read-only 2×2 dashboard covering the whole repository:
  1. **By State:** counts and percentage share across every status (including hidden `Deleted`).
  2. **By Type:** Open, Closed, Total, and a proportional `Open %` bar (excluding `Deleted`).
  3. **By Priority Tier:** normalized priority breakdown (excluding `Deleted`).
  4. **By Subsystem:** scrollable breakdown sorted by open count (excluding `Deleted`).
  Clicking any row label or count jumps directly to the matching filtered **list** view.

### Sort order

The `priority | recent | oldest` control orders **List** and **Board** views:

- **priority:** highest priority tier first, then severity, then most recently updated (default when a repo has ≤ 100 open tickets).
- **recent:** most recently updated first (default when a repo has > 100 open tickets).
- **oldest:** least recently updated first, for triaging stale backlogs.

### Quick queues and orthogonal `role` scope

Quick-queue pills beneath the header let you pivot in one click:

- **Mine (`@user`)**, **Submitted**, **Involved** (assigned, submitted, or commented), **Unassigned**, **Active 30d**, and **Pending**.
- Up to three **pinned views** configured in `ticket-common` appear as dashed pills at the right end of the bar.

Role scope (`scope=mine`, `submitted`, `mine_or_sub`, `involved`, `unassigned`) is **orthogonal** to `Open | Closed | All`. Picking **Mine** or **Submitted** and switching to **Closed** or **All** keeps your role filter active instead of dropping it. The **role** facet popover offers all five scopes with live counts for the current state tab.

### Facets, normalized priorities, and search

- Every facet (`role`, `assignee`, `type`, `priority`, `subsystem`, `status`, `severity`) is a lightweight `<details>` popover showing live counts. Any menu with more than 12 items automatically gets a sticky inline search input at the top.
- **Normalized priority tiers:** Repositories migrated from legacy trackers often mix bare numeric priorities (`9`, `7`) with labeled values (`9 Immediate`, `7 High`). The `priority` facet, `pr=` URL parameter, **By Priority Tier** summary card, and `group=priority` board normalize both forms into a single tier (`pr=9` matches `9 Immediate`, `9`, and `Immediate`).
- **Search bar:** matches title, subsystem, type, assignee, submitter, `foundin` version, and ticket UUID prefix. Clicking **Full-text** hands the query to Fossil's `/tktsrch` to search descriptions and comments.

### Timestamps (Human Time-of-Day)

All list, table, and board timestamps format automatically in the **viewer's local timezone**:

- Recent tickets read naturally (`Today morning`, `Yesterday evening`, `Fri afternoon`).
- Older tickets show the weekday and ISO date (`Tue 2025-10-07`).
- Hovering any timestamp reveals the exact local date and time in a tooltip.
- Clicking any timestamp cycles every timestamp on the page through four modes (saved in `localStorage`):
  1. `human` (default, viewer-local day + time of day)
  2. `updated` (compact `YYYY-MM-DD HH:MM`)
  3. `created` (creation date)
  4. `relative` (`3d ago`, `4mo ago`)

Without JavaScript, timestamps fall back cleanly to `YYYY-MM-DD` (UTC).

### Reports popover and `/rptview` SQL reports

Click **Reports ▾** in the header to open:

1. **Pinned views** (if configured in `ticket-common`), linking straight to filtered workbench views.
2. **Saved SQL reports** (Fossil's built-in `reportfmt` queries at `/rptview?rn=N`).
3. Admin links (**New report format**, **Pending moderation**) when you hold the required capability.

On `/rptview` pages, custom SQL reports often paint rows with bright or named CSS colors (`white`, `#f2dcdc`, `#cfe8bd`). The skin applies a theme-aware color veil (`--report-veil`) and `--link-on-tint` link color so arbitrary report palettes stay readable at WCAG AA contrast in both dark and light builds.

---

## 5. Viewing, Creating, and Editing Tickets

### Ticket detail (`/tktview`)

- **Inline title edit:** writers (`w`) see a pencil icon beside the title to edit and save in place without leaving the page.
- **Sidebar metadata menus:** `Status`, `Type`, `Priority`, `Severity`, `Resolution`, `Subsystem`, and `Assignee` render as `<details>` popovers that auto-save on selection (with an explicit Save button fallback when JavaScript is disabled).
- **Exact field history:** ticket changes display `Old → New` field diff chips inline in the activity timeline.
- **Backlinks and hover previews:** linked check-ins, wiki pages, and forum posts list cleanly under the description. Hovering or focusing any `[hash]` link to a ticket, check-in, or forum post opens a preview popover card.
- **Attachment lightbox:** image attachments render as a thumbnail grid above the file list; clicking any thumbnail opens a native `<dialog>` lightbox.
- **Resolve and comment:** writers can change status/resolution and post a comment in one submission.

### Composer: Write / Preview gate, slash snippets, and drafts

Because Fossil ticket artifacts are permanent, both `/tktnew` and the `/tktview` comment box include:

- **Write / Preview tabs:** switching to **Preview** renders Markdown/Wiki through Fossil's `/ajax/preview-text` endpoint.
- **Preview gate:** creating a ticket or posting a comment prompts you to preview first whenever you edit the body.
- **Slash commands (`/`):** typing `/` at the start of a line opens a menu of Markdown blocks (code fence, task list, table, quote, etc.).
- **Tab drafts:** unfinished text auto-saves to `sessionStorage` per ticket so accidental reloads do not lose work.

### New ticket (`/tktnew`)

- **Type pills with starter templates:** picking `Bug`/`Code_Defect`, `RFE`/`Feature_Request`, `Documentation`, or `Build_Problem` pre-fills a structured Markdown template when the description is empty.
- **Similar-ticket detector:** as you type a title, existing matching tickets appear below the field so you can avoid filing duplicates.
- **Keyboard shortcuts:**
  - `Cmd/Ctrl + Enter` — first press previews, second press creates the ticket.
  - `Shift + Cmd/Ctrl + Enter` — creates the ticket and opens a blank form for the next one (after preview).
  - `V`, `P`, `U` — focus Severity, Priority, or Subsystem triage chip (when not typing in a text field).
  - `1`–`9` — pick an option inside a focused select.
  - `/` — open Markdown block menu at the start of a line.

---

## 6. Per-Repo Ticket Configuration (`ticket-common`)

Two optional TH1 variables in Fossil's existing `ticket-common` script let each repository customize the Ticket Workbench with zero schema changes and zero SQL edits.

### `tkt_unassigned_aliases`

A list of legacy or retired logins that should count as **Unassigned** (in addition to blank and `nobody`). Matching tickets:

- appear in the **Unassigned** quick queue, `role: unassigned`, `assignee: (unassigned)`, and the Board's **Unassigned** column;
- display a dashed amber `@user · reassign` badge so maintainers can tell an orphaned ticket apart from a freshly unassigned one;
- remain individually selectable in the `assignee` popover as `@user (alias)`.

Up to 8 custom aliases (plus `nobody`) are bound as SQLite parameters.

### `tkt_saved_views`

A flat list of `Label QueryString` pairs defining reusable workbench views. Each entry:

- appears under **Pinned views** at the top of the **Reports ▾** popover;
- places its first 3 entries as dashed quick-access pills in the quick-queue bar.

Query strings accept any `/reportlist` parameter (`st`, `view`, `sort`, `group`, `q`, `tp`, `pr`, `sv`, `sb`, `fs`, `scope`, `as`, `age`, `done`).

### Complete `ticket-common` example

```tcl
# Existing choices (keep whatever your repository already defines)
set status_choices {Open Pending Closed Deleted}

# Treat retired or placeholder owners as Unassigned (shows "@user · reassign")
set tkt_unassigned_aliases {nobody miguel msofer}

# Pinned workbench views (flat Label / QueryString pairs)
set tkt_saved_views {
  {Blocking}           {st=open&pr=9}
  {Most Stale}         {st=open&sort=oldest}
  {Recent Closed Bugs} {st=closed&tp=Bug&age=30}
  {Zipfs}              {st=open&q=zipfs}
}
```

### Applying `ticket-common` from the command line

To edit `ticket-common` in the web UI, go to **Admin → Tickets → Common**. To append the variables from the shell without disturbing existing definitions:

```sh
fossil config export ticket /tmp/tkt.cfg -R /path/to/repo.fossil
# or update the 'ticket-common' row in the repository's config table
```

---

## 7. Timeline, Chat, Mobile, and Accessibility

- **Timeline weekdays:** every timeline date row gains its full weekday name (`Monday`, `Tuesday`, ...) computed in the browser from the date Fossil prints, matching UTC or local display.
- **Branch and chat colors:** dark builds mute Fossil's dark branch tints (`--tint-mute: 0.4`) and chat sender bubbles (`--chat-mute: 0.3`) toward the surface; light builds show Fossil's pastels unmuted (`0`).
- **Chat embedded attachments:** Fossil's `/chat-download?render` iframes for Markdown, Wiki, and plain text inherit the active skin's dark or light tokens and auto-size cleanly.
- **Phones and tablets:**
  - The **☰** menu opens as a full-height scrollable sheet while locking background scroll and keeping the top nav bar sticky.
  - The main menu keeps all links in a horizontally scrollable bar with **☰** pinned on the left.
  - Interactive controls use 44 px minimum touch targets and 16 px inputs on coarse pointers to prevent iOS Safari zoom.
  - Wide tables scroll inside their own container, and ticket/admin forms stack label above field.
- **Accessibility and zero-JS fallback:**
  - All primary surfaces target WCAG AA contrast (≥ 4.5:1 for normal text and links).
  - `a11y.js` adds `role="main"`, `aria-expanded` / `aria-controls` / `Escape` handling on **☰**, `scope="col"` and keyboard sorting on sortable tables, and `viewBox` scaling on Fossil's activity charts.
  - Every core workflow — filtering, facet popovers, pagination, summary tables, board card moves, inline title edits, and sidebar edits — works with JavaScript disabled.

---

## 8. Building and Customizing

If you modify `skin/css.txt`, `skin/header.txt`, `skin/footer.txt`, or `www/a11y.js`, rebuild all four importable files:

```sh
python3 skin/build.py
```

### Troubleshooting

- **Search link missing from the menu bar:** `mainmenu` requires Fossil 2.20+. Older Fossil versions ignore `mainmenu` and show their built-in menu.
- **Search page returns no results:** enable and build Fossil's FTS index (`fossil fts-config enable ...` and `fossil fts-config index on`).
- **Colors look washed out after switching dark ↔ light:** make sure you imported the matching `.cfg` build rather than overriding CSS tokens alone; `details` must have `white-foreground: 1` for dark and `0` for light.
- **`apply.py` skipped ticket templates on a repo:** repos with a custom `ticket-table` require `skin-tickets` on line 5 of their `.meta` sidecar file before `apply.py` writes `ticket-*` templates.
- **Strict security checks (`vuln-report=fatal`):** all ticket templates bind every parameter and custom alias as SQLite variables with zero SQL string interpolation.