From b8107bf88eb48221d696c154e4b57aad43af17df Mon Sep 17 00:00:00 2001 From: ElbekDeveloper Date: Thu, 30 Apr 2026 15:47:35 +0500 Subject: [PATCH 1/4] [Spec Kit] Clarify specification --- .specify/feature.json | 2 +- .../checklists/requirements.md | 42 ++++ specs/002-shared-ui-primitives/spec.md | 186 ++++++++++++++++++ 3 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 specs/002-shared-ui-primitives/checklists/requirements.md create mode 100644 specs/002-shared-ui-primitives/spec.md diff --git a/.specify/feature.json b/.specify/feature.json index 2773329..baec9c2 100644 --- a/.specify/feature.json +++ b/.specify/feature.json @@ -1,3 +1,3 @@ { - "feature_directory": "specs/001-auth-setup" + "feature_directory": "specs/002-shared-ui-primitives" } diff --git a/specs/002-shared-ui-primitives/checklists/requirements.md b/specs/002-shared-ui-primitives/checklists/requirements.md new file mode 100644 index 0000000..0be4a48 --- /dev/null +++ b/specs/002-shared-ui-primitives/checklists/requirements.md @@ -0,0 +1,42 @@ +# Specification Quality Checklist: Shared UI Primitives + +**Purpose**: Validate specification completeness and quality before proceeding to planning +**Created**: 2026-04-30 +**Feature**: [spec.md](../spec.md) + +## Content Quality + +- [x] No implementation details (languages, frameworks, APIs) + _Note: Angular signals/OnPush/ControlValueAccessor references are unavoidable — they ARE + the deliverable for a component library targeting Angular projects._ +- [x] Focused on user value and business needs + _Framed around developer workflows: "developer can use without additional config"._ +- [x] Written for non-technical stakeholders + _Caveated: developer is the primary stakeholder; component API references are appropriate._ +- [x] All mandatory sections completed + +## Requirement Completeness + +- [x] No [NEEDS CLARIFICATION] markers remain +- [x] Requirements are testable and unambiguous +- [x] Success criteria are measurable +- [x] Success criteria are technology-agnostic (no implementation details) + _Note: SC-004 references `ng build` — justified exception for a component library spec._ +- [x] All acceptance scenarios are defined +- [x] Edge cases are identified (dual disabled+loading, empty errorMessage, self-contained spinner ARIA) +- [x] Scope is clearly bounded (3 primitives, single-line only, no icons, dark-theme only) +- [x] Dependencies and assumptions identified + +## Feature Readiness + +- [x] All functional requirements have clear acceptance criteria +- [x] User scenarios cover primary flows (Button P1, TextInput P2, Spinner P3) +- [x] Feature meets measurable outcomes defined in Success Criteria +- [x] No implementation details leak into specification + _Caveated: see Content Quality note above._ + +## Notes + +- All items pass. No spec updates required before `/speckit-clarify` or `/speckit-plan`. +- The intentional use of Angular/component terminology is consistent with the feature's nature as + a developer-facing component library. Justified deviation from the "technology-agnostic" guideline. diff --git a/specs/002-shared-ui-primitives/spec.md b/specs/002-shared-ui-primitives/spec.md new file mode 100644 index 0000000..6b94d56 --- /dev/null +++ b/specs/002-shared-ui-primitives/spec.md @@ -0,0 +1,186 @@ +# Feature Specification: Shared UI Primitives + +**Feature Branch**: `002-shared-ui-primitives` +**Created**: 2026-04-30 +**Status**: Draft +**Input**: User description: "Build reusable primitives used across login and chat pages." + +## User Scenarios & Testing *(mandatory)* + +### User Story 1 - Button Component (Priority: P1) + +A developer building the login form or chat page needs a button that handles primary actions +(e.g., "Sign in", "Send") and secondary actions (e.g., "Cancel"). The button handles the +loading state automatically — when a loading flag is set, the button disables itself and shows +a spinner, preventing double-submission. + +**Why this priority**: Buttons are the most frequently used interactive primitive. Every form +action and chat operation depends on them. No feature UI can be built without this. + +**Independent Test**: Add `Sign In` +to any component. Confirm it renders with the accent-color background, correct typography, and +transitions to a spinner state when `[loading]="true"` — all without additional configuration. + +**Acceptance Scenarios**: + +1. **Given** a page with ``, **When** it renders, **Then** the + button displays with the accent color background and the correct token-based typography. +2. **Given** a primary button with `[loading]="true"`, **When** it renders, **Then** the button + shows a spinner, is non-interactive, and does not emit click events. +3. **Given** a button focused via keyboard, **When** it receives focus, **Then** a visible focus + ring appears meeting WCAG 2.4.7 minimum contrast (≥ 3:1). +4. **Given** a button with `[disabled]="true"`, **When** the user clicks or keyboard-activates it, + **Then** no action triggers and the cursor indicates the disabled state. + +--- + +### User Story 2 - Text Input Component (Priority: P2) + +A developer building the login form needs a text input that renders a label above it, displays +validation error messages below it, and integrates with Angular Reactive Forms without manual +`ControlValueAccessor` wiring in the consuming component. + +**Why this priority**: The login form depends on accessible, Reactive-Forms-compatible inputs. +Without this primitive the login feature cannot meet accessibility or form validation requirements. + +**Independent Test**: Add `` +inside a `[formGroup]`. Confirm the label is visually and programmatically associated, the control +value updates on input, and the error message appears/disappears with `errorMessage` binding. + +**Acceptance Scenarios**: + +1. **Given** a TextInput with a `label` input, **When** it renders, **Then** a `