Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<!-- Door: one-way (hard to undo: a tagged-release config key, stored setting, contract field, or transport behaviour changes; data is deleted) or two-way (a revert undoes it).
Blast radius: what a defect breaks, in one line (one window, every backend, the push transport only). -->

## Refactor later
<!-- The reason is one line that starts with `Refactor later:`, naming why a file with entries in scripts/ci/concept-rules.json stays unfixed; read only with the `refactor-later` label. Delete this section otherwise. -->

## Verification
- [ ] `pnpm build` passes (includes tsc typecheck)
- [ ] `pnpm test` passes
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
- run: pnpm test # vitest run
- run: pnpm map:check # architecture map matches the tree
- run: pnpm css:check # one owner per bare class selector across src/**/*.css
- run: pnpm rules:check # one-way-per-concept rules; pull requests run it in test-guard against the base
if: github.event_name == 'push'
- run: pnpm logger:check # createLogger namespace equals the file name
- run: pnpm commands:check # no Tauri command takes a file path from the webview
- run: pnpm timers:check # timers are called detached, never as a method (WebKit throws)
Expand Down Expand Up @@ -144,6 +146,20 @@ jobs:
skip=1
fi
RULE_TESTS_SKIP="$skip" bash scripts/ci/rule-tests.sh "origin/${{ github.event.pull_request.base.ref }}"
- name: Keep one way per concept
env:
GH_TOKEN: ${{ github.token }}
# Labels and the PR body are read at run time, so re-running the job picks up a label or a "Refactor later:" line added after the PR opened.
run: |
pr=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
labels=$(jq -r '.labels[].name' <<<"$pr")
change=
later=
if grep -qx rule-change <<<"$labels"; then change=1; fi
if grep -qx refactor-later <<<"$labels"; then
later=$(jq -r '.body // ""' <<<"$pr" | tr -d '\r' | sed -n 's/^Refactor later:[[:space:]]*//p' | head -n 1)
fi
CONCEPT_RULES_CHANGE_OK="$change" CONCEPT_RULES_LATER_REASON="$later" node scripts/ci/concept-rules.mjs "origin/${{ github.event.pull_request.base.ref }}"

readme-pair:
name: readme-pair (README.md and README.ja.md change together)
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Any code change — feature · bugfix · refactor · UI · schema · or any chor
- Grow the system in layers: start from a minimal end-to-end working version and add features on top of working results. Never trade working code for unfinished complexity.
- Separate components into modules with clear separation of concerns. Core logic lives in its own module behind an explicit interface (inputs in, results out); the main flow — an `index.ts`, a shell, a `create*` factory — only imports modules and routes I/O between them. A new handler, flag, or branch goes into a module, never inline into the file that composes others. A composing file that has started holding logic shows it as a closure over many DOM references or flags read by nested functions, or a `dispose()` that knows every section's cleanup; move the block out before adding to it.
- Group files by feature, inside a layered top level. `src/` is ordered `contract`, `tauri-env`, `logger` → `config` → `renderer` → `settings` → `io` → `dispatcher` → `ambient` → `ui` → `app` → `windows`, and a folder or root file imports only from what sits to its left. Inside a layer, a folder holds one feature's files or one sub-folder per feature, nested until a folder holds one feature (`io/window/pet/`); sibling sub-folders may import each other. A new module joins the sub-folder of its feature; a new feature opens its own sub-folder; a feature's wiring sits with the feature when it imports only leftward, and in `app/` otherwise. A flat folder that lists the files of two or more features side by side and tells them apart by a name prefix or suffix (`filler-*`, `*-section`) is an anti-pattern: split it before adding to it. A folder holding one feature's `wire-*` files in `app/`, or one `*-settings.ts` per backend under `settings/backend/`, is one feature's files and not this anti-pattern.
- One way per concept: the rules live in `scripts/ci/concept-rules.json`, checked by `pnpm rules:check`.
- Write only the test cases needed to confirm a feature actually works. Piling on test cases for volume's sake is an anti-pattern, not thoroughness.
- Prefer proven, maintained libraries when they lower overall complexity or raise stability. Check already-installed dependencies before implementing something yourself or adding a package — and never claim "this library can't do that" without checking its docs and types.
- Make architecture decisions with a long-term view. Reject stopgaps that only get past today and must be replaced later.
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ CI runs it in the `web` job.
- **Comments: minimal, present-tense only.** One line, only what the code
cannot say itself — no decision history, spec citations, or issue numbers. A
numeric constant's comment may name the measurement it came from.
- **One way per concept.** The rules live in `scripts/ci/concept-rules.json`, checked by `pnpm rules:check`.
- **Docs: current-state only.** Write what the system *is*, declaratively,
matching the code — no change narrative, no PR/issue numbers as prose, no
dated changelogs, no future/unbuilt work. Every page the docs site builds
Expand Down
1 change: 1 addition & 0 deletions docs/agent-guide/harness-enforcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Claude Code hooks under `.claude/` are gitignored, so they gate only a checkout
| Required PR checks | GitHub ruleset `main: required PR checks` requires `web`, `lint`, `rust`, `rust-windows`, `test-guard`, `pr-title`; `python`, `python-lint`, `plugins-rust`, and `vrt` run but are not required |
| New/changed behavior ships a test | `test-guard` CI job (`skip-tests` label bypass; the job reads the PR's labels at run time, so the label takes effect on the next `test-guard` run — re-run the job after labelling) |
| A rule test is never loosened | the `rule-tests` step of the `test-guard` job fails a PR that edits, moves, or deletes a code file carrying a `rule-test:` line (a doc, `*.md`, that only mentions it does not count) (`rule-change` label bypass, read at run time like `skip-tests`); `pnpm gates` runs it too |
| One way per concept: the rules in `scripts/ci/concept-rules.json` hold | `test-guard` job (`scripts/ci/concept-rules.mjs` against the base), `pnpm gates`, and `web` on main (`pnpm rules:check`); `rule-change` label, and `refactor-later` label with a `Refactor later:` PR-body line, bypass it, read at run time |
| `README.md` and `README.ja.md` change together | `readme-pair` CI job and `pnpm gates` (`scripts/ci/readme-pair.sh`; `readme-one-language` label bypass, read at run time like `skip-tests`) |
| Conventional, printable-ASCII PR titles | `pr-title` job in `.github/workflows/pr-title.yml` (checks the conventional type and `subjectPattern ^[\x20-\x7E]+$`, and the body for an AI attribution line; English itself is working practice). It also runs on a title or body edit, so a fixed title clears the check without a new push |
| Rendered surfaces match their committed screenshots in both themes | `vrt` CI job (`pnpm test:vrt`: Vitest browser mode on Linux WebKit; references from the `vrt-update` workflow) |
Expand Down
1 change: 1 addition & 0 deletions docs/agent-guide/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ YUI/ # The repository: the app, the Rust shell,
endpoint-fields/ # The endpoint field rows the chat, TTS and STT sections share
server-line/ # The STT and TTS server lines
status-line/ # The status line the chat, server and plugin lines share: its dot, text and action
check-line/ # The checking, error and fade lines of a key or server check
key-entry/ # The pasted-key row and the key page link
help/ # The bundled guides
key-row/ # One secret API key row
Expand Down
11 changes: 6 additions & 5 deletions mocks/settings/card-drop.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="stylesheet" href="../../src/ui/quick-controls/preset/preset.css">
<link rel="stylesheet" href="../../src/ui/quick-controls/persona/card/card-section.css">
<link rel="stylesheet" href="../../src/ui/quick-controls/connection/quick-start/quick-start.css">
<link rel="stylesheet" href="../../src/ui/quick-controls/sections/check-line/check-line.css">
<link rel="stylesheet" href="../../src/ui/quick-controls/sections/key-entry/key-entry.css">
<style>
@font-face { font-family: "Pretendard JP Variable"; src: url("../../public/fonts/PretendardJPVariable.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
Expand Down Expand Up @@ -67,15 +68,15 @@
.veil.is-on .veil__in { transform: none; }
.veil.is-busy .veil__in { border-color: var(--yui-edge-strong); }
.veil.is-refused .veil__in { border-color: var(--yui-danger-soft); }
.veil__msg, .veil .yui-start__err { grid-area: 1 / 1; transition: opacity var(--yui-dur-fast) var(--yui-ease); }
.veil__msg, .veil .yui-check__err { grid-area: 1 / 1; transition: opacity var(--yui-dur-fast) var(--yui-ease); }
.veil__msg { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 0 1.5rem; }
.veil__msg svg { width: 1.75rem; height: 1.75rem; color: var(--yui-accent-ink); }
.veil.is-busy .veil__msg svg { color: var(--yui-text-mute); }
.veil__title { margin: 0; font-size: var(--yui-fs-head); font-weight: 600; }
.veil__sub { margin: 0; font-size: var(--yui-fs-sub); color: var(--yui-text-mute); }
.veil .yui-start__err { max-width: 22rem; opacity: 0; }
.veil .yui-check__err { max-width: 22rem; opacity: 0; }
.veil.is-refused .veil__msg { opacity: 0; }
.veil.is-refused .yui-start__err { opacity: 1; }
.veil.is-refused .yui-check__err { opacity: 1; }

/* Variant B: only the Card section takes an outline while a file is over the window. */
.yui-sec.yui-card { border-radius: var(--yui-radius-group); outline: 1.5px dashed transparent; outline-offset: 8px; transition: outline-color var(--yui-dur-fast) var(--yui-ease); }
Expand Down Expand Up @@ -215,7 +216,7 @@ <h2 class="yui-tabpanel__title">일반</h2>
<p class="veil__title" id="veilTitle">놓으면 가져와요</p>
<p class="veil__sub" id="veilSub">프리셋 파일(.yui)이나 JSON·PNG 카드 하나</p>
</div>
<div class="yui-start__err" role="alert"><svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="8.5" stroke="currentColor" stroke-width="2"/><path d="M12 7.5v5.5M12 16.2v.1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg><div id="veilErr"></div></div>
<div class="yui-check__err" role="alert"><svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="8.5" stroke="currentColor" stroke-width="2"/><path d="M12 7.5v5.5M12 16.2v.1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg><div id="veilErr"></div></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -336,7 +337,7 @@ <h2 class="yui-tabpanel__title">일반</h2>
$("veilErr").textContent = text;
const v = $("veil"); v.classList.add("is-on", "is-refused");
refuseTimer = setTimeout(() => { v.classList.remove("is-on"); later(200, () => v.classList.remove("is-refused")); }, 2400);
caption(state, "E1: 덮개가 그 자리에서 문구로 바뀌고 2.4초 뒤 사라집니다(누르면 바로 닫힘). 문구 모양은 빠른 시작의 거절 줄(.yui-start__err)입니다. 열린 페이지는 그대로입니다. " + tail);
caption(state, "E1: 덮개가 그 자리에서 문구로 바뀌고 2.4초 뒤 사라집니다(누르면 바로 닫힘). 문구 모양은 빠른 시작의 거절 줄(.yui-check__err)입니다. 열린 페이지는 그대로입니다. " + tail);
} else {
const moved = ui.page !== "persona";
showPage("persona");
Expand Down
Loading
Loading