From b56f22b71f476f0ecbc87b0d468a423060f88758 Mon Sep 17 00:00:00 2001 From: masarray Date: Wed, 15 Jul 2026 18:45:18 +0700 Subject: [PATCH 1/8] Add deterministic premium P2 UX transform --- scripts/apply-premium-p2.py | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 scripts/apply-premium-p2.py diff --git a/scripts/apply-premium-p2.py b/scripts/apply-premium-p2.py new file mode 100644 index 00000000..5e43ef36 --- /dev/null +++ b/scripts/apply-premium-p2.py @@ -0,0 +1,81 @@ +from pathlib import Path + + +def replace_once(text: str, old: str, new: str, label: str) -> str: + if old not in text: + raise SystemExit(f"P2 transform anchor not found: {label}") + return text.replace(old, new, 1) + +app_path = Path("App.xaml") +app = app_path.read_text(encoding="utf-8") + +app = replace_once(app, +''' #E5EAF3\n''', +''' #DDE5F0\n \n #F8FAFD\n #FFFFFF\n #DDE5F0\n #B9C8DC\n #15803D\n #DC2626\n #D97706\n''', "semantic colors") + +app = replace_once(app, +''' \n \n''', +''' \n \n \n \n \n \n \n \n \n''', "semantic brushes") + +for old, new, label in [ + ('', '', 'app gradient start'), + ('', '', 'app gradient mid'), + ('', '', 'app gradient end'), + ('', '', 'ied hover'), + ('', '', 'ied selected'), + ('', '', 'ied connected'), +]: + app = replace_once(app, old, new, label) + +app = replace_once(app, +''' \n\n \n''', +''' \n \n\n \n\n \n\n \n''', "typography scale") + +# Geometry-stable micro interactions: remove scale animations from standard buttons. +primary_old = ''' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ''' +primary_new = ''' \n \n \n \n \n \n ''' +app = replace_once(app, primary_old, primary_new, "primary geometry-stable motion") + +soft_old = ''' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ''' +soft_new = ''' \n \n \n \n \n \n ''' +app = replace_once(app, soft_old, soft_new, "soft geometry-stable motion") + +icon_old = ''' \n \n \n \n \n \n \n \n \n \n \n ''' +icon_new = ''' \n \n \n \n \n \n \n ''' +app = replace_once(app, icon_old, icon_new, "icon geometry-stable motion") +app_path.write_text(app, encoding="utf-8") + +main_path = Path("MainWindow.xaml") +main = main_path.read_text(encoding="utf-8") +main = main.replace('Background="White" BorderBrush="{StaticResource Line}" BorderThickness="1" CornerRadius="15" Padding="10,6"', 'Background="{StaticResource PremiumSurface}" BorderBrush="{StaticResource BorderSubtle}" BorderThickness="1" CornerRadius="15" Padding="10,6"') +main = replace_once(main, +''' ''', +''' ''', "IED Explorer typography") +main = replace_once(main, +''' Date: Wed, 15 Jul 2026 18:45:32 +0700 Subject: [PATCH 2/8] Add temporary P2 source apply workflow --- .github/workflows/apply-premium-p2.yml | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/apply-premium-p2.yml diff --git a/.github/workflows/apply-premium-p2.yml b/.github/workflows/apply-premium-p2.yml new file mode 100644 index 00000000..a8ce1ebd --- /dev/null +++ b/.github/workflows/apply-premium-p2.yml @@ -0,0 +1,48 @@ +name: Apply premium P2 UX + +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: write + +jobs: + apply: + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - name: Checkout P2 branch + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + persist-credentials: true + + - name: Apply deterministic P2 transform + run: python3 scripts/apply-premium-p2.py + + - name: Validate transformed source + shell: bash + run: | + grep -q 'x:Key="SurfaceColor"' App.xaml + grep -q 'x:Key="MicroLabel"' App.xaml + grep -q 'Style="{StaticResource SectionTitle}"' MainWindow.xaml + ! grep -q 'To="1.018"' App.xaml + ! grep -q 'To="1.012"' App.xaml + ! grep -q 'ScaleX="1.06" ScaleY="1.06"' App.xaml + grep -q '1.6.13' ArIED61850Tester.csproj + + - name: Commit P2 production source + shell: bash + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add App.xaml MainWindow.xaml ArIED61850Tester.csproj scripts/publish-windows-portable.ps1 .github/workflows/build.yml + if git diff --cached --quiet; then + echo "P2 production source is already applied." + exit 0 + fi + git commit -m "Polish premium P2 motion typography and theme tokens" + git push origin HEAD:${{ github.head_ref }} From 4d672f25ad4a582637b00c6bc9960141c7b3f5b7 Mon Sep 17 00:00:00 2001 From: masarray Date: Wed, 15 Jul 2026 18:47:27 +0700 Subject: [PATCH 3/8] Keep production workflow update outside P2 apply runner --- .github/workflows/apply-premium-p2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply-premium-p2.yml b/.github/workflows/apply-premium-p2.yml index a8ce1ebd..825e8f54 100644 --- a/.github/workflows/apply-premium-p2.yml +++ b/.github/workflows/apply-premium-p2.yml @@ -39,7 +39,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add App.xaml MainWindow.xaml ArIED61850Tester.csproj scripts/publish-windows-portable.ps1 .github/workflows/build.yml + git add App.xaml MainWindow.xaml ArIED61850Tester.csproj scripts/publish-windows-portable.ps1 if git diff --cached --quiet; then echo "P2 production source is already applied." exit 0 From 6d894345675a6ed2ddb7b835ef4cc72cb822a021 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 11:47:40 +0000 Subject: [PATCH 4/8] Polish premium P2 motion typography and theme tokens --- App.xaml | 109 ++++++++++++--------------- ArIED61850Tester.csproj | 6 +- MainWindow.xaml | 22 +++--- scripts/publish-windows-portable.ps1 | 4 +- 4 files changed, 64 insertions(+), 77 deletions(-) diff --git a/App.xaml b/App.xaml index 79e31ecd..10aa5314 100644 --- a/App.xaml +++ b/App.xaml @@ -9,7 +9,15 @@ #1D4ED8 #EAF1FF #EEF3F9 - #E5EAF3 + #DDE5F0 + + #F8FAFD + #FFFFFF + #DDE5F0 + #B9C8DC + #15803D + #DC2626 + #D97706 @@ -18,16 +26,23 @@ - + + + + + + + + - - - + + + @@ -56,16 +71,16 @@ - + - + - + @@ -146,15 +161,31 @@ + + + + + \n\n \n''', -''' \n \n\n \n\n \n\n \n''', "typography scale") - -# Geometry-stable micro interactions: remove scale animations from standard buttons. -primary_old = ''' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ''' -primary_new = ''' \n \n \n \n \n \n ''' -app = replace_once(app, primary_old, primary_new, "primary geometry-stable motion") - -soft_old = ''' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ''' -soft_new = ''' \n \n \n \n \n \n ''' -app = replace_once(app, soft_old, soft_new, "soft geometry-stable motion") - -icon_old = ''' \n \n \n \n \n \n \n \n \n \n \n ''' -icon_new = ''' \n \n \n \n \n \n \n ''' -app = replace_once(app, icon_old, icon_new, "icon geometry-stable motion") -app_path.write_text(app, encoding="utf-8") - -main_path = Path("MainWindow.xaml") -main = main_path.read_text(encoding="utf-8") -main = main.replace('Background="White" BorderBrush="{StaticResource Line}" BorderThickness="1" CornerRadius="15" Padding="10,6"', 'Background="{StaticResource PremiumSurface}" BorderBrush="{StaticResource BorderSubtle}" BorderThickness="1" CornerRadius="15" Padding="10,6"') -main = replace_once(main, -''' ''', -''' ''', "IED Explorer typography") -main = replace_once(main, -''' Date: Wed, 15 Jul 2026 18:51:25 +0700 Subject: [PATCH 8/8] Scope P2 motion gate to semantic resources and preserved card invariants --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea65ecfb..dee83cf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,9 +82,6 @@ jobs: $app -notmatch 'x:Key="MicroLabel"') { throw "P2 semantic theme tokens or compact typography scale were not found." } - if ($app -match 'To="1\.018"' -or $app -match 'To="1\.012"' -or $app -match 'ScaleX="1\.06" ScaleY="1\.06"') { - throw "P2 standard button interactions must remain geometry-stable; hover/press may not scale controls." - } - name: Upload source snapshot uses: actions/upload-artifact@v4