Skip to content

Commit d305d84

Browse files
Y-PLONImmichaelush
andcommitted
מערכת עיצוב: איחוד העבודה מ־#4269
כל השינויים מ־277 הקומיטים של PR #4269, עד dad7284, ללא שינוי בתוכן הקבצים. כולל טוקנים וערכת נושא, רכיבי ממשק משותפים, הסבת מסכים, תיקוני דיווחים, בדיקות וכללי אכיפה. התיעוד והכרעות העיצוב המקוריים נשמרים. Co-authored-by: mmichaelush <104845712+mmichaelush@users.noreply.github.com> Co-authored-by: Y-Ploni <116633732+Y-PLONI@users.noreply.github.com> Co-authored-by: ypl <7353755@gmail.com>
1 parent b2994bd commit d305d84

733 files changed

Lines changed: 45922 additions & 16677 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ assets/semantic/** -text
2121
# Assemble scripts are release assets that several jobs upload; every checkout must
2222
# hold the same bytes, Windows included.
2323
tool/release/assemble_split_asset.ps1 text eol=lf
24+
25+
# ui_lint baseline - the CLI writes LF and ui_lint_test compares it byte-for-byte.
26+
tool/ui_lint/baseline.json text eol=lf

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,30 @@ Fixes #
2121
| לפני | אחרי |
2222
|------|------|
2323
| | |
24+
25+
## שינוי חזותי? (מערכת העיצוב)
26+
27+
<!-- מלאו רק כשה-PR משנה ממשק. התקן המחייב: docs/design-system/DESIGN_SYSTEM.md,
28+
ואיך עובדים לפיו: §8 שם. סעיף שלא רלוונטי: כתבו "אין". -->
29+
30+
לפני הפתיחה:
31+
32+
- [ ] אין PR פתוח אחר על אותו נושא, והענף מעודכן מול `dev`
33+
- [ ] אין ב-PR קבצים שלא קשורים לשינוי
34+
- [ ] ההכרעות העיצוביות שהשינוי נשען עליהן כבר אושרו (`DESIGN_DECISIONS.md`)
35+
- [ ] `dart tool/ui_lint_cli.dart` נקי. גידול ב-`baseline.json` דורש תווית `ui-baseline`, ושינוי ב-PNG של golden דורש תווית `goldens-approved`
36+
37+
בתיאור:
38+
39+
1. **מטרה:**
40+
2. **הכרעות (DD-xx):**
41+
3. **מה תוקן** (מה היה שגוי קודם):
42+
4. **קבצי תשתית שהשתנו** (theme, `lib/widgets/`, `tool/ui_lint`):
43+
5. **רכיבים ומסכים מושפעים:**
44+
6. **השפעה על התנהגות:**
45+
7. **צילומי לפני/אחרי** מאותו תרחיש ובאותו גודל (בטבלה למעלה)
46+
8. **בדיקות שהורצו:**
47+
9. **בדיקות שלא הורצו:**
48+
10. **חריגים שנשארו** (הערות `ui-lint: allow`, רשומות baseline):
49+
11. **סיכוני רגרסיה:**
50+
12. **PRs קשורים:**

‎.github/workflows/flutter_tests.yml‎

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ jobs:
143143
- name: Check plugin SDK spec is fresh
144144
run: dart run tool/plugins/generate_plugin_spec.dart --check
145145

146+
# דוח ui_lint מול tool/ui_lint/baseline.json (docs/design-system/CI_ENFORCEMENT.md).
147+
# ה-step הזה רק מדווח: חריגות חדשות מסומנות ב-annotations ולא מכשילות את ה-job.
148+
# השער החוסם הוא test/design_system/ui_lint_test.dart, שרץ ב-shards של job ה-test.
149+
- name: UI lint report
150+
continue-on-error: true
151+
run: dart tool/ui_lint_cli.dart --format=github
152+
146153
# בדיקות ה־CI: analyze + test (פורמט נבדק locally ב־lint).
147154
- name: Analyze
148155
run: flutter analyze
@@ -548,14 +555,51 @@ jobs:
548555
git config --global core.longpaths true
549556
flutter pub get --enforce-lockfile
550557
551-
# ההיקף מכוון וצר: הסוללה המלאה רצה על Linux ב-4 shards. כאן רצות
558+
# ההיקף מכוון וצר: הסוללה המלאה רצה על Linux ב-5 shards. כאן רצות
552559
# רק הקבוצות שאומתו כירוקות ב-Windows (1,073 בדיקות, ועוד 146 של
553560
# personal_notes), והקבוצות הידועות כתלויות-סביבה או flaky (migration,
554561
# installer, tools/calendar) נשארות ל-Linux בלבד. הרחבת ההיקף מחייבת אימות
555562
# מקומי ב-Windows קודם — אחרת ה-job נהיה רועש ומתחילים להתעלם ממנו.
556563
- name: Run Windows-relevant tests
557564
run: flutter test -j 4 test/core/ test/tabs/ test/navigation/ test/workspaces/ test/personal_notes/ test/utils/file/native_sha256_test.dart test/external_catalog/external_catalog_repository_test.dart
558565

566+
# Golden tests (docs/design-system/CI_ENFORCEMENT.md §5, DD-22): Windows היא
567+
# פלטפורמת הייחוס, ולכן test/goldens/ מוחרג מה-shards של Linux
568+
# (tool/ci/test_shards.dart). כשל מעלה את תמונות ההשוואה כ-artifact.
569+
goldens_windows:
570+
name: Goldens (Windows)
571+
runs-on: windows-2025
572+
timeout-minutes: 20
573+
574+
steps:
575+
- name: Checkout code
576+
uses: actions/checkout@v7.0.1
577+
578+
- name: Setup Flutter
579+
uses: subosito/flutter-action@v2
580+
with:
581+
channel: stable
582+
flutter-version: 3.47.7
583+
cache: true
584+
585+
- name: Install dependencies
586+
shell: pwsh
587+
run: |
588+
git config --global core.longpaths true
589+
flutter pub get --enforce-lockfile
590+
591+
- name: Run golden tests
592+
run: flutter test test/goldens/
593+
594+
- name: Upload golden failures
595+
if: failure()
596+
uses: actions/upload-artifact@v7.0.2
597+
with:
598+
name: golden-failures
599+
path: test/goldens/**/failures/
600+
if-no-files-found: ignore
601+
retention-days: 7
602+
559603
build_linux:
560604
name: Build (Linux)
561605
runs-on: ubuntu-26.04
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Goldens Guard
2+
3+
# תמונות הייחוס של test/goldens/ משתנות רק בשינוי ממשק מכוון
4+
# (docs/design-system/CI_ENFORCEMENT.md §5.10, DD-23). PR שמוסיף, משנה או
5+
# מוחק PNG תחת test/goldens/ צריך את התווית goldens-approved, שמתחזק מוסיף
6+
# אחרי שבדק את ה-diff של התמונות. golden שנכשל ב-PR שלא נגע בתמונות הוא רגרסיה.
7+
8+
on:
9+
pull_request:
10+
branches:
11+
- main
12+
- dev
13+
types: [opened, synchronize, reopened, labeled, unlabeled]
14+
15+
permissions:
16+
contents: read
17+
pull-requests: read
18+
19+
concurrency:
20+
group: goldens-guard-${{ github.event.pull_request.number }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
guard:
25+
name: Golden image changes
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check golden image changes
29+
env:
30+
GH_TOKEN: ${{ github.token }}
31+
REPO: ${{ github.repository }}
32+
PR_NUMBER: ${{ github.event.pull_request.number }}
33+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
34+
APPROVED_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'goldens-approved') }}
35+
run: |
36+
set -euo pipefail
37+
changed=$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files" \
38+
--jq '.[] | select((.filename | test("^test/goldens/.*\\.png$")) or ((.previous_filename // "") | test("^test/goldens/.*\\.png$"))) | .status + " " + .filename')
39+
if [ -z "$changed" ]; then
40+
echo "No golden image changed."
41+
exit 0
42+
fi
43+
echo "Changed golden images:"
44+
echo "$changed"
45+
# ה־PR שמכניס את תשתית ה־golden: ב־base אין אף תמונה, ולכן אין מה
46+
# שהשתנה. תמונות חדשות נבדקות בסקירת ה־PR הזה עצמו.
47+
base_count=$(gh api "repos/$REPO/git/trees/$BASE_SHA?recursive=1" \
48+
--jq '[.tree[].path | select(test("^test/goldens/.*\\.png$"))] | length')
49+
if [ "$base_count" = "0" ] && ! echo "$changed" | grep -qv '^added '; then
50+
echo "The base has no golden images: this pull request introduces them."
51+
exit 0
52+
fi
53+
if [ "$APPROVED_LABEL" = "true" ]; then
54+
echo "Golden changes approved with the 'goldens-approved' label."
55+
exit 0
56+
fi
57+
echo "::error::This pull request changes golden images under test/goldens/. Golden images change only with an intended UI change. A maintainer reviews the image diff and adds the 'goldens-approved' label."
58+
exit 1
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Regenerate goldens
2+
3+
# מצייר מחדש את תמונות הייחוס של test/goldens/ על Windows, בגרסת Flutter
4+
# המוצמדת, ומעלה אותן כ-artifact. כך גם תורם בלי Windows יכול לעדכן golden:
5+
# מריצים על הענף, מורידים את ה-artifact ומבצעים commit לתמונות. PR שמשנה
6+
# תמונה צריך את התווית goldens-approved (goldens_guard.yml).
7+
8+
on:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
regenerate:
16+
name: Regenerate goldens (Windows)
17+
runs-on: windows-2025
18+
timeout-minutes: 20
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v7.0.1
23+
24+
- name: Setup Flutter
25+
uses: subosito/flutter-action@v2
26+
with:
27+
channel: stable
28+
flutter-version: 3.47.7
29+
cache: true
30+
31+
- name: Install dependencies
32+
shell: pwsh
33+
run: |
34+
git config --global core.longpaths true
35+
flutter pub get --enforce-lockfile
36+
37+
- name: Update golden files
38+
run: flutter test --update-goldens test/goldens/
39+
40+
- name: Upload golden files
41+
uses: actions/upload-artifact@v7.0.2
42+
with:
43+
name: goldens
44+
path: test/goldens/**/goldens/*.png
45+
retention-days: 7
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: UI Baseline Guard
2+
3+
# tool/ui_lint/baseline.json הוא החוב הקיים מול תקן הממשק
4+
# (docs/design-system/CI_ENFORCEMENT.md §3.4, DD-23). הוא יכול רק לקטון:
5+
# `dart tool/ui_lint_cli.dart --update-baseline` מוחק רשומות שתוקנו. PR שמוסיף
6+
# מופע לכלל באותו קובץ ובאותו scope צריך את התווית ui-baseline, שמתחזק מוסיף.
7+
# גם החרגת נתיב חדשה או מורחבת ב־tool/ui_lint/config.yaml משתיקה חריגות בלי
8+
# baseline, ולכן גם היא צריכה את אותה תווית.
9+
10+
on:
11+
pull_request:
12+
branches:
13+
- main
14+
- dev
15+
types: [opened, synchronize, reopened, labeled, unlabeled]
16+
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ui-baseline-guard-${{ github.event.pull_request.number }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
guard:
26+
name: ui_lint baseline growth
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v7.0.1
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Check baseline growth
35+
env:
36+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
37+
BASELINE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'ui-baseline') }}
38+
run: |
39+
set -euo pipefail
40+
path=tool/ui_lint/baseline.json
41+
# ה־PR שמכניס את ui_lint: ב־base אין baseline ואין config, ולכן אין
42+
# מול מה למדוד גידול. ה־baseline הראשון הוא רישום החוב (§3.4).
43+
if ! git cat-file -e "$BASE_SHA:$path" 2>/dev/null; then
44+
echo "The base has no $path: this pull request introduces the ui_lint baseline, so there is no growth to check."
45+
exit 0
46+
fi
47+
git show "$BASE_SHA:$path" > /tmp/base.json
48+
python3 - /tmp/base.json "$path" > /tmp/growth.txt <<'PY'
49+
import json, sys
50+
51+
# Per rule, file and scope: a fingerprint change (an edited
52+
# expression, or a new engine version) is not growth.
53+
def counts(path):
54+
data = json.load(open(path, encoding="utf-8"))
55+
totals = {}
56+
for rule, files in data["rules"].items():
57+
for file, entries in files.items():
58+
for entry in entries:
59+
key = (rule, file, entry["scope"])
60+
totals[key] = totals.get(key, 0) + entry["n"]
61+
return totals
62+
63+
base, head = counts(sys.argv[1]), counts(sys.argv[2])
64+
for key, n in sorted(head.items()):
65+
added = n - base.get(key, 0)
66+
if added > 0:
67+
print(f"+{added} {key[0]} {key[1]} ({key[2]})")
68+
PY
69+
# A new or edited path exclusion silences findings without a baseline
70+
# entry. A changed glob shows up as an added line too.
71+
config=tool/ui_lint/config.yaml
72+
git diff --unified=0 "$BASE_SHA" HEAD -- "$config" \
73+
| { grep -E '^\+[[:space:]]*(-[[:space:]]*)?path:' || true; } \
74+
| sed -E 's/^\+[[:space:]]*(-[[:space:]]*)?/exclude /' > /tmp/excludes.txt
75+
if [ ! -s /tmp/growth.txt ] && [ ! -s /tmp/excludes.txt ]; then
76+
echo "The ui_lint baseline did not grow, and no path exclusion was added."
77+
exit 0
78+
fi
79+
if [ -s /tmp/growth.txt ]; then
80+
echo "Baseline additions:"
81+
cat /tmp/growth.txt
82+
fi
83+
if [ -s /tmp/excludes.txt ]; then
84+
echo "Path exclusions added or changed in $config:"
85+
cat /tmp/excludes.txt
86+
fi
87+
if [ "$BASELINE_LABEL" = "true" ]; then
88+
echo "Baseline growth and exclusions approved with the 'ui-baseline' label."
89+
exit 0
90+
fi
91+
if [ -s /tmp/growth.txt ]; then
92+
echo "::error file=$path::This pull request adds entries to the ui_lint baseline. Fix the new violations, or mark a justified one with '// ui-lint: allow UIL-xxx — reason'. If the debt is intended, ask a maintainer to add the 'ui-baseline' label."
93+
fi
94+
if [ -s /tmp/excludes.txt ]; then
95+
echo "::error file=$config::This pull request adds or widens a path exclusion in the ui_lint config, which silences findings without a baseline entry. Prefer '// ui-lint: allow UIL-xxx — reason' on the single node, or ask a maintainer to add the 'ui-baseline' label."
96+
fi
97+
exit 1

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,6 @@ assets/bundled_plugins/*
159159
# ומגיע לעשרות אלפי שורות. אינו אמור להיכנס לגיט.
160160
build_log.txt
161161
isolate.pdf
162+
163+
# תמונות השוואה של golden tests שנכשלו (test/goldens/<רכיב>/failures/).
164+
test/goldens/**/failures/

0 commit comments

Comments
 (0)