mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
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]>
74 lines
2.7 KiB
TypeScript
74 lines
2.7 KiB
TypeScript
/**
|
|
* Test that Tabs onInteraction fires with layout measurements on native.
|
|
* Regression test for: createTabs tab layout measurement broken on native
|
|
* since commit 525e303 which replaced onLayout with web-only ResizeObserver.
|
|
*/
|
|
|
|
import { by, element, expect, waitFor } from 'detox'
|
|
import { safeLaunchApp, withSync } from './utils/detox'
|
|
|
|
// Launch model: directUseCase renders the case at app root, so we launch the
|
|
// native app ONCE in beforeAll and never relaunch. The three tests are
|
|
// order-safe (only the last one taps a tab; nothing depends on post-tap state),
|
|
// so no per-test reset is needed. safeLaunchApp leaves synchronization disabled
|
|
// after launch, which the Tabs onLayout-busy screen requires.
|
|
describe('TabsOnInteraction', () => {
|
|
beforeAll(async () => {
|
|
await safeLaunchApp({
|
|
newInstance: true,
|
|
launchArgs: { directUseCase: 'TabsOnInteraction' },
|
|
})
|
|
await waitFor(element(by.id('tabs-root')))
|
|
.toExist()
|
|
.withTimeout(180000)
|
|
})
|
|
|
|
it('should fire onInteraction with layout for the default selected tab', async () => {
|
|
// tab1 is defaultValue, so onInteraction should fire with 'select' and a layout
|
|
await waitFor(element(by.id('tabs-layout-has-value')))
|
|
.toHaveText('hasLayout: true')
|
|
.withTimeout(5000)
|
|
|
|
await expect(element(by.id('tabs-interaction-type'))).toHaveText(
|
|
'interaction: select'
|
|
)
|
|
})
|
|
|
|
it('should have non-zero layout dimensions', async () => {
|
|
await waitFor(element(by.id('tabs-layout-has-value')))
|
|
.toHaveText('hasLayout: true')
|
|
.withTimeout(5000)
|
|
|
|
// width and height should not be 'null' or '0'
|
|
const widthEl = element(by.id('tabs-layout-width'))
|
|
const heightEl = element(by.id('tabs-layout-height'))
|
|
|
|
// verify they don't show null
|
|
await expect(widthEl).not.toHaveText('width: null')
|
|
await expect(heightEl).not.toHaveText('height: null')
|
|
await expect(widthEl).not.toHaveText('width: 0')
|
|
await expect(heightEl).not.toHaveText('height: 0')
|
|
})
|
|
|
|
it('should fire onInteraction when switching tabs', async () => {
|
|
// wait for initial layout
|
|
await waitFor(element(by.id('tabs-layout-has-value')))
|
|
.toHaveText('hasLayout: true')
|
|
.withTimeout(5000)
|
|
|
|
// tap tab2 — requires sync briefly for reliable tap delivery
|
|
await withSync(() => element(by.id('tabs-tab2')).tap())
|
|
|
|
// content should switch
|
|
await waitFor(element(by.id('tabs-content-tab2')))
|
|
.toBeVisible()
|
|
.withTimeout(5000)
|
|
|
|
// onInteraction should still have a layout
|
|
await expect(element(by.id('tabs-layout-has-value'))).toHaveText('hasLayout: true')
|
|
await expect(element(by.id('tabs-interaction-type'))).toHaveText(
|
|
'interaction: select'
|
|
)
|
|
})
|
|
})
|