Pular para o conteúdo

Padrões

Padrões UX cross-cutting renderizados direto das specs .kmd canônicas. Cada padrão carrega a lista de triggers que o /k-housekeep usa pra detectar quando aplica, mais o corpo completo da spec e referências.

Padrões

Errors facet — index

errors

errors/README.kmd

Índice navegável (não-autoritativo) das specs de erro da Koder Stack. Cada conceito de erro — classes, severidade, identificadores, envelope, texto humano, captura, retenção, padrões de código — tem UMA spec dona. Este README mapeia "conceito → dono" para que ninguém reimplemente nem duplique.

Error Model (canonical error envelope)

errors

errors/model.kmd

O envelope canônico, máquina-legível, de um erro na Koder Stack: os campos obrigatórios (dados mínimos exigíveis) e opcionais (dados complementares) de um objeto de erro, as regras para preencher os complementares, e o mapeamento para resposta HTTP (problem+json) que todo backend Koder emite e todo cliente parseia.

Error Reporting (all modules)

errors

errors/reporting.kmd

Relatório de erros para todos os módulos Koder: toggle "Relatório automático" obrigatório em Settings (default OFF, ausência = desabilitado), botão "Reportar problema" sempre visível, grupos de dados A–G, contrato de privacidade (o que nunca capturar), retenção e acesso.

Error Taxonomy (classes, severity, retryability)

errors

errors/taxonomy.kmd

Vocabulário canônico de erros da Koder Stack: o enum fechado de CLASSES (categorias funcionais — `DL`, `UP`, `AU`, `NW`, `DB`, `UI`, `IO`, `PM`, `VL`, `XX`), a definição semântica + regra de desempate de cada classe, a escala de SEVERIDADE (`fatal`/`error`/`warning`/`info`) e a classificação de RETRYABILITY.

User-Facing Error Messages

errors

errors/user-facing-messages.kmd

Toda mensagem de erro exibida a usuário final deve ter (1) texto humanizado em pt-BR/en-US, (2) botão "Ver detalhes" expandindo o erro técnico bruto, (3) ID único `<PRODUCT>-<CAT>-<CODE>-<SEQ>` para correlação com logs e suporte.

Internationalization (i18n) Cross-Surface Contract

i18n

i18n/contract.kmd

Contrato cross-surface de internacionalização da Koder Stack: idioma padrão = locale do dispositivo, seletor de idioma em local canônico por surface (Flutter app, Web/landing, CLI, TUI, TV, Server-rendered HTML), persistência, fallback chain en-US, key-naming, validação por testes TDD.

i18n leak detection

i18n

i18n/leak-detection.kmd

Detection contract for "i18n leaks" — user-facing string literals

i18n TDD Test Template (Cross-Surface)

i18n

i18n/test-template.kmd

Template normativo de testes TDD pra validar conformidade com `specs/i18n/contract.kmd` em qualquer módulo Koder, qualquer surface (Flutter mobile/desktop/TV, Web, Server-rendered HTML, CLI, TUI).

Scoped Consent Tokens

identity

identity/consent.kmd

Koder ID issues, validates, and revokes signed, scoped consent tokens.

Login Identifier Resolution

identity

identity/login-resolution.kmd

How Koder ID (and any SDK or library that performs client-side pre-validation) resolves what the user typed in the "Email" field to the target user record.

Password policy

identity

identity/password-policy.kmd

The NCSC/NIST-aligned password rules for Koder ID — the ONLY surface in the Stack that accepts a user password, since Koder ID is the sole identity provider (auth/oauth-flow.kmd R1).

Admin data table pattern

patterns

patterns/admin-data-table.kmd

Canonical composition pattern for Koder admin tools that list typed records (Forge repo list, Kdrive folder browser, Hub publisher catalog, future Koder ID admin, etc.).

AI agent state hooks (useKoderAgent / useKoderChat)

patterns

patterns/ai-agent-state-hooks.kmd

Framework-neutral state-machine contract for any AI chat / agent surface in a Koder product — message list, streaming state, append handlers, abort, retry, tool-call lifecycle.

AI chat surface primitives

patterns

patterns/ai-chat-surface.kmd

Six composable primitives for assembling an AI chat surface in any Koder product — Bubble, Sender, Suggestion, Attachment, Conversations, ThoughtChain.

AI feature visual language

patterns

patterns/ai-feature-visual-language.kmd

Canonical visual lexicon for distinguishing AI-driven surfaces from

AI welcome / first-run screen

patterns

patterns/ai-welcome-screen.kmd

First-message hero an AI chat surface renders when the user hasn't sent anything yet — mark + greeting + capability hint + 3-4 starter prompts that pre-fill the composer (do NOT auto-send).

Approval gate pattern

patterns

patterns/approval-gate.kmd

A paused step that waits for an authorized human to approve or reject a pending action — a deploy/release gate, a content-moderation hold, a sensitive-operation sign-off.

Audit log surface

patterns

patterns/audit-log.kmd

The immutable, filterable trail of "who did what, when" for a tenant — security/compliance events rendered as a sortable, searchable, exportable events table with a stable event model and tamper-evidence.

Callout card pattern

patterns

patterns/callout-card.kmd

Dismissible in-product nudge — illustration + heading + body + CTA — placed inside a primary surface (settings, dashboard) to surface a new capability without interrupting.

Code review surface

patterns

patterns/code-review.kmd

The pull-request review surface: a diff (diff-viewer) overlaid with threaded line comments, a review-decision flow (comment / approve / request changes), per-thread resolved/unresolved state, and a batched "pending review" submission.

Confirmation page pattern

patterns

patterns/confirmation-page.kmd

The receipt surface shown AFTER a user successfully completes a transaction or submission: a prominent success panel with a reference number, an explicit "what happens next" section, and confirmation that any follow-up (email/SMS) was sent.

Content overflow pattern

patterns

patterns/content-overflow.kmd

What to do when content exceeds its container: truncate with an ellipsis + a way to see the full value (tooltip / expand), scroll a bounded region, or a "show more" reveal — and the wrap rules that decide which.

CRUD page template

patterns

patterns/crud-page.kmd

The list → detail → edit scaffold for managing records of one entity: an admin data-table list with create/row actions, a read detail view, and a form-page editor with validation — plus the create and delete (confirmed) flows that connect them.

Dashboard page template

patterns

patterns/dashboard-page.kmd

The analytics/overview page scaffold: a scoped filter bar, a row of metric cards (the KPIs), and a grid of charts and small tables — read- first, with drill-downs to the detail surfaces.

Empty state pattern

patterns

patterns/empty-state.kmd

Purpose-built UI for "no data yet" surfaces — illustration + heading + body + primary action.

Error page template

patterns

patterns/error-page.kmd

The full-page error template (404 / 500 / permission / expired session): a plain-language message stating what happened, why, and how to recover, with an **embedded search** and recovery links so the user can get back on task instead of hitting a dead end.

Feature paywall + access restriction

patterns

patterns/feature-paywall.kmd

Two sibling sub-patterns: (a) **paywall** — what surfaces when a feature is gated by a paid tier the user hasn't subscribed to; (b) **permission restriction** — what surfaces when the user lacks the required role / scope.

Form page pattern

patterns

patterns/form-page.kmd

A single editing surface with section-grouped fields and a sticky save/discard bar that appears when the form is dirty — the edit-a-record / settings page (as opposed to a step-by-step wizard).

Form validation pattern

patterns

patterns/form-validation.kmd

How a form tells the user what is wrong and how to fix it: inline validation on blur, a top-of-form error summary that links to each offending field with a *corrective* message (not just "invalid"), required/optional marking on the label, two-tier helper text, progress on long forms, and an explicit success confirmation.

Inline edit pattern

patterns

patterns/inline-edit.kmd

Edit a single value in place — a click-to-edit field that swaps its read view for an input, commits on Enter/blur, and reverts on Esc — without navigating to a separate form.

Onboarding / product-tour pattern

patterns

patterns/onboarding.kmd

First-run guidance: a progressive product tour of chained coach-marks that introduces a surface the first time a user reaches it, always skippable and never-again-dismissable, with its seen-state persisted so it does not repeat.

One thing per page pattern

patterns

patterns/one-thing-per-page.kmd

A form-design constraint: each page in a flow asks the user for ONE thing — one decision or one logically-grouped piece of information — with a single primary action.

Report page template

patterns

patterns/report-page.kmd

The parameterized-report scaffold: a filter/parameter panel, a Run action, and a tabular and/or graphical result the user reads or exports (CSV/PDF/print).

Task list pattern

patterns

patterns/task-list.kmd

Section-level overview for LONG, multi-part journeys split into named tasks, each carrying an explicit completion status and dependency gating.

VCS activity timeline

patterns

patterns/vcs-activity-timeline.kmd

The chronological event stream on a code-hosting issue or pull request: comments interleaved with typed activity events (committed, labeled, assigned, referenced, closed, merged, reviewed), each with a semantic event icon/color, actor avatar, and relative timestamp.

Multi-step wizard

patterns

patterns/wizard-multistep.kmd

Linear or branching multi-step flow with per-step validation, step indicator, back-stack semantics, review step, and submit + error recovery.