Skip to content

Commit 8a0fe5a

Browse files
committed
Add shared text foundation
1 parent 87e1e11 commit 8a0fe5a

11 files changed

Lines changed: 399 additions & 346 deletions

docs_build/dev/BUILD_PR.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
# PR_26177_004-shared-color-foundation
1+
# PR_26177_005-shared-text-foundation
22

33
## Purpose
44

5-
Add a small shared color foundation.
5+
Add a small shared text foundation.
66

77
## Source Of Truth
88

9-
This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth for `PR_26177_004-shared-color-foundation`.
9+
This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth for `PR_26177_005-shared-text-foundation`.
1010

1111
## Stack
1212

13-
- Base branch: `PR_26177_003-shared-geometry-foundation`
13+
- Base branch: `PR_26177_004-shared-color-foundation`
1414

1515
## Exact Scope
1616

17-
- Add `src/shared/color/` foundation.
18-
- Include hex/rgb/hsl conversion, clamp, lerp/blend helpers, luminance/contrast basics.
19-
- Add targeted tests for the shared color area.
20-
- No page styling changes.
17+
- Add `src/shared/text/` foundation.
18+
- Include safe string helpers such as slugify, casing, truncate, escapeHtml, and normalizeWhitespace.
19+
- Add targeted tests for the shared text area.
20+
- No copy rewrites outside tests/docs.
2121
- Create required Codex reports under `docs_build/dev/reports/`.
2222
- Create repo-structured delta ZIP under `tmp/`.
2323

2424
## Exact Targets
2525

2626
- `docs_build/dev/PLAN_PR.md`
2727
- `docs_build/dev/BUILD_PR.md`
28-
- `src/shared/color/color.js`
29-
- `tests/shared/ColorFoundation.test.mjs`
30-
- `docs_build/dev/reports/PR_26177_004-shared-color-foundation.md`
31-
- `docs_build/dev/reports/PR_26177_004-shared-color-foundation_branch-validation.md`
32-
- `docs_build/dev/reports/PR_26177_004-shared-color-foundation_requirement-checklist.md`
33-
- `docs_build/dev/reports/PR_26177_004-shared-color-foundation_validation-lane.md`
34-
- `docs_build/dev/reports/PR_26177_004-shared-color-foundation_manual-validation-notes.md`
28+
- `src/shared/text/text.js`
29+
- `tests/shared/TextFoundation.test.mjs`
30+
- `docs_build/dev/reports/PR_26177_005-shared-text-foundation.md`
31+
- `docs_build/dev/reports/PR_26177_005-shared-text-foundation_branch-validation.md`
32+
- `docs_build/dev/reports/PR_26177_005-shared-text-foundation_requirement-checklist.md`
33+
- `docs_build/dev/reports/PR_26177_005-shared-text-foundation_validation-lane.md`
34+
- `docs_build/dev/reports/PR_26177_005-shared-text-foundation_manual-validation-notes.md`
3535
- `docs_build/dev/reports/codex_review.diff`
3636
- `docs_build/dev/reports/codex_changed_files.txt`
3737

3838
## Out Of Scope
3939

40-
- No page styling changes.
40+
- No copy rewrites outside tests/docs.
4141
- No browser-owned product data.
4242
- No runtime UI changes.
4343
- No browser storage changes.
@@ -51,9 +51,9 @@ This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth f
5151
Run exactly:
5252

5353
```powershell
54-
node ./scripts/run-node-test-files.mjs tests/shared/ColorFoundation.test.mjs
55-
node --check src/shared/color/color.js
56-
node --check tests/shared/ColorFoundation.test.mjs
54+
node ./scripts/run-node-test-files.mjs tests/shared/TextFoundation.test.mjs
55+
node --check src/shared/text/text.js
56+
node --check tests/shared/TextFoundation.test.mjs
5757
git diff --check
5858
```
5959

@@ -62,5 +62,5 @@ git diff --check
6262
Create repo-structured delta ZIP:
6363

6464
```text
65-
tmp/PR_26177_004-shared-color-foundation_delta.zip
65+
tmp/PR_26177_005-shared-text-foundation_delta.zip
6666
```

docs_build/dev/PLAN_PR.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
# PLAN_PR: PR_26177_004-shared-color-foundation
1+
# PLAN_PR: PR_26177_005-shared-text-foundation
22

33
## Purpose
44

5-
Add a small shared color foundation.
5+
Add a small shared text foundation.
66

77
## Scope
88

9-
- Add `src/shared/color/` foundation.
10-
- Include hex/rgb/hsl conversion helpers.
11-
- Include clamp, lerp/blend helpers, luminance, and contrast basics.
9+
- Add `src/shared/text/` foundation.
10+
- Include safe string helpers for whitespace normalization, slug/casing, truncation, and HTML escaping.
1211
- Add targeted tests.
13-
- No page styling changes.
12+
- No copy rewrites outside tests/docs.
1413
- No browser-owned product data.
1514
- No runtime UI changes.
1615
- No unrelated cleanup.
1716

1817
## Implementation Plan
1918

20-
1. Add `src/shared/color/color.js`.
21-
2. Add `tests/shared/ColorFoundation.test.mjs`.
22-
3. Validate conversion, blending, luminance, and contrast helpers.
19+
1. Add `src/shared/text/text.js`.
20+
2. Add `tests/shared/TextFoundation.test.mjs`.
21+
3. Validate safe string helpers.
2322
4. Produce required Codex reports and repo-structured ZIP.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26177_005-shared-text-foundation
2+
3+
Date: 2026-06-26
4+
Scope: Shared text foundation
5+
Status: PASS
6+
7+
## Summary
8+
9+
- Added `src/shared/text/text.js`.
10+
- Added safe string helpers for whitespace normalization, slug/casing, truncation, and HTML escaping.
11+
- Added targeted tests in `tests/shared/TextFoundation.test.mjs`.
12+
- No copy rewrites, runtime UI, browser product-data ownership, API/database, or unrelated cleanup changes were made.
13+
14+
## Validation
15+
16+
- PASS: `node ./scripts/run-node-test-files.mjs tests/shared/TextFoundation.test.mjs`.
17+
- PASS: `node --check src/shared/text/text.js`.
18+
- PASS: `node --check tests/shared/TextFoundation.test.mjs`.
19+
- PASS: `git diff --check`.
20+
21+
## Artifact
22+
23+
- `tmp/PR_26177_005-shared-text-foundation_delta.zip`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# PR_26177_005-shared-text-foundation Branch Validation
2+
3+
- PASS: Current branch is `PR_26177_005-shared-text-foundation`.
4+
- PASS: Branch is stacked on `PR_26177_004-shared-color-foundation`.
5+
- PASS: Scope is documentation/report files plus shared text code and tests only.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26177_005-shared-text-foundation Manual Validation Notes
2+
3+
- Reviewed scope against the user request and BUILD document.
4+
- Confirmed the change does not alter UI, storage, API, database, scheduler, or engine behavior.
5+
- Confirmed no `start_of_day` files were modified.
6+
- Confirmed ZIP artifact path: `tmp/PR_26177_005-shared-text-foundation_delta.zip`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# PR_26177_005-shared-text-foundation Requirement Checklist
2+
3+
- PASS: One PR purpose only.
4+
- PASS: Smallest valid scoped change.
5+
- PASS: No unrelated cleanup.
6+
- PASS: Did not modify `start_of_day` folders.
7+
- PASS: Did not add browser product-data ownership.
8+
- PASS: Used ES modules consistent with repo style.
9+
- PASS: Added `src/shared/text/` foundation.
10+
- PASS: Included `slugify`, casing, `truncate`, `escapeHtml`, and `normalizeWhitespace` helpers.
11+
- PASS: No copy rewrites outside tests/docs.
12+
- PASS: Added targeted tests for the shared text area.
13+
- PASS: Did not run full samples smoke by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PR_26177_005-shared-text-foundation Validation Lane
2+
3+
- PASS: `node ./scripts/run-node-test-files.mjs tests/shared/TextFoundation.test.mjs`.
4+
- PASS: `node --check src/shared/text/text.js`.
5+
- PASS: `node --check tests/shared/TextFoundation.test.mjs`.
6+
- PASS: `git diff --check`.
7+
8+
Full samples smoke was intentionally not run because this PR changes only a shared helper module and targeted tests.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
docs_build/dev/BUILD_PR.md
22
docs_build/dev/PLAN_PR.md
3-
docs_build/dev/reports/PR_26177_004-shared-color-foundation.md
4-
docs_build/dev/reports/PR_26177_004-shared-color-foundation_branch-validation.md
5-
docs_build/dev/reports/PR_26177_004-shared-color-foundation_manual-validation-notes.md
6-
docs_build/dev/reports/PR_26177_004-shared-color-foundation_requirement-checklist.md
7-
docs_build/dev/reports/PR_26177_004-shared-color-foundation_validation-lane.md
3+
docs_build/dev/reports/PR_26177_005-shared-text-foundation.md
4+
docs_build/dev/reports/PR_26177_005-shared-text-foundation_branch-validation.md
5+
docs_build/dev/reports/PR_26177_005-shared-text-foundation_manual-validation-notes.md
6+
docs_build/dev/reports/PR_26177_005-shared-text-foundation_requirement-checklist.md
7+
docs_build/dev/reports/PR_26177_005-shared-text-foundation_validation-lane.md
88
docs_build/dev/reports/codex_changed_files.txt
99
docs_build/dev/reports/codex_review.diff
10-
src/shared/color/color.js
11-
tests/shared/ColorFoundation.test.mjs
10+
src/shared/text/text.js
11+
tests/shared/TextFoundation.test.mjs

0 commit comments

Comments
 (0)