Files
zeekayandHanzo Dev 69c6e860d7 transplant onto tamagui v2.6.0, brand as a re-runnable transform
This repo could never sync. There was NO merge-base with tamagui — 372 commits
here against 15,791 there, unrelated histories — because it began as a
copy-paste rebrand with a flattened layout. Every "sync" since was a hand
re-application that drifted, which is why the tree sat on 7.3.1 while upstream
shipped fixes we then rediscovered by hand.

This commit's PARENT IS TAMAGUI. A future sync is `git merge tama/main` then
`node scripts/rebrand.mjs` — a real merge, because the history is now shared.

174 packages: 166 upstream, our 8 restored (chrome, shell, telemetry, recipes,
get, font-geist-{sans,mono}, @hanzo/booker), bento-get gained. 170/170 build.

Our patches to files UPSTREAM ALSO OWNS are carried, which the package-level
delta missed and which was where the value actually was:
  - useMedia's server snapshot (`initState ?? getMedia()`). Upstream still
    returns undefined there, so every Tamagui Dialog kills a prerender — the
    exact crash hanzo.app spent a day on.
  - data-slot on web host nodes, absent upstream entirely.
Both applied ONTO upstream's newer files (it rewrote useMedia +150/-63 and
createComponent +160/-55), marked `PATCH (ours, carried across the transplant)`.

Seven traps are encoded in scripts/rebrand.mjs, each found by a gate:
skip itself and lockfiles; special-case the double-branded names in BOTH scoped
and bare form; map path strings, not just paths; drop a level for the flattened
group; check disk rather than a stale index.

Rust build artifacts are NOT committed. An earlier draft of this commit swept
apps/desktop/src-tauri/target/debug in via `git add -A` — 3,859 files including
a 272MB .a, over GitHub's 100MB cap, so the push could never have landed. They
are gitignored now.

Co-Authored-By: Hanzo Dev <[email protected]>
2026-07-30 18:25:06 -07:00

71 lines
3.0 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { setupPage } from './test-utils'
import { getStyles } from './utils'
import { TEST_IDS } from '../src/constants/test-ids'
test.beforeEach(async ({ page }) => {
await setupPage(page, { name: 'ThemeChange', type: 'useCase' })
})
test('Initial theme (yellow) renders with correct colors', async ({ page }) => {
// The expected yellow theme color in RGB format (themeDev palette)
const expectedYellowColor = 'rgb(255, 221, 0)'
// Get the theme info text to verify we're on yellow theme
const themeInfo0 = await page.locator(`#${TEST_IDS.themeInfo}-0`).textContent()
const themeInfo1 = await page.locator(`#${TEST_IDS.themeInfo}-1`).textContent()
// Verify both levels show yellow theme
expect(themeInfo0).toContain('"theme":"yellow"')
expect(themeInfo1).toContain('"theme":"yellow"')
// Get the styles for all squares
const staticSquare0Styles = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-0`))
const staticSquare1Styles = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-1`))
const dynamicSquare0Styles = await getStyles(
page.locator(`#${TEST_IDS.dynamicSquare}-0`)
)
const dynamicSquare1Styles = await getStyles(
page.locator(`#${TEST_IDS.dynamicSquare}-1`)
)
// Verify all squares have the yellow theme color
expect(staticSquare0Styles.backgroundColor).toBe(expectedYellowColor)
expect(staticSquare1Styles.backgroundColor).toBe(expectedYellowColor)
expect(dynamicSquare0Styles.backgroundColor).toBe(expectedYellowColor)
expect(dynamicSquare1Styles.backgroundColor).toBe(expectedYellowColor)
})
test('Inner theme change does not affect outer theme', async ({ page }) => {
// Initial colors (themeDev palette)
const initialYellowColor = 'rgb(255, 221, 0)'
// Get initial styles for both levels
const outerSquareInitial = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-0`))
const innerSquareInitial = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-1`))
// Verify both start with yellow
expect(outerSquareInitial.backgroundColor).toBe(initialYellowColor)
expect(innerSquareInitial.backgroundColor).toBe(initialYellowColor)
// Click the inner theme change button
await page.locator(`#${TEST_IDS.changeThemeButton}-1`).click()
// Get updated styles
const outerSquareAfter = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-0`))
const innerSquareAfter = await getStyles(page.locator(`#${TEST_IDS.staticSquare}-1`))
// Verify outer square remains yellow
expect(outerSquareAfter.backgroundColor).toBe(initialYellowColor)
// Verify inner square has changed (not yellow anymore)
expect(innerSquareAfter.backgroundColor).not.toBe(initialYellowColor)
// Verify theme info text reflects changes
const outerThemeInfo = await page.locator(`#${TEST_IDS.themeInfo}-0`).textContent()
const innerThemeInfo = await page.locator(`#${TEST_IDS.themeInfo}-1`).textContent()
expect(outerThemeInfo).toContain('"theme":"yellow"')
expect(innerThemeInfo).not.toContain('"theme":"yellow"')
})