termcast 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +30 -12
- package/dist/build.js.map +1 -1
- package/dist/cli.js +0 -40
- package/dist/cli.js.map +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +7 -1
- package/dist/compile.js.map +1 -1
- package/dist/components/bar-graph.d.ts +23 -8
- package/dist/components/bar-graph.d.ts.map +1 -1
- package/dist/components/bar-graph.js +84 -40
- package/dist/components/bar-graph.js.map +1 -1
- package/dist/components/dotted-line-graph.d.ts +86 -0
- package/dist/components/dotted-line-graph.d.ts.map +1 -0
- package/dist/components/dotted-line-graph.js +260 -0
- package/dist/components/dotted-line-graph.js.map +1 -0
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +1 -10
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/graph.d.ts.map +1 -1
- package/dist/components/graph.js +7 -1
- package/dist/components/graph.js.map +1 -1
- package/dist/components/histogram.d.ts +42 -0
- package/dist/components/histogram.d.ts.map +1 -0
- package/dist/components/histogram.js +115 -0
- package/dist/components/histogram.js.map +1 -0
- package/dist/components/horizontal-bar-graph.d.ts +47 -0
- package/dist/components/horizontal-bar-graph.d.ts.map +1 -0
- package/dist/components/horizontal-bar-graph.js +137 -0
- package/dist/components/horizontal-bar-graph.js.map +1 -0
- package/dist/components/list.d.ts +9 -0
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +84 -21
- package/dist/components/list.js.map +1 -1
- package/dist/examples/bar-graph-weekly.js +2 -2
- package/dist/examples/bar-graph-weekly.js.map +1 -1
- package/dist/examples/charts-showcase-barchart.d.ts +2 -0
- package/dist/examples/charts-showcase-barchart.d.ts.map +1 -0
- package/dist/examples/charts-showcase-barchart.js +10 -0
- package/dist/examples/charts-showcase-barchart.js.map +1 -0
- package/dist/examples/charts-showcase-bargraph.d.ts +2 -0
- package/dist/examples/charts-showcase-bargraph.d.ts.map +1 -0
- package/dist/examples/charts-showcase-bargraph.js +60 -0
- package/dist/examples/charts-showcase-bargraph.js.map +1 -0
- package/dist/examples/charts-showcase-candle.d.ts +2 -0
- package/dist/examples/charts-showcase-candle.d.ts.map +1 -0
- package/dist/examples/charts-showcase-candle.js +30 -0
- package/dist/examples/charts-showcase-candle.js.map +1 -0
- package/dist/examples/charts-showcase-graph.d.ts +2 -0
- package/dist/examples/charts-showcase-graph.d.ts.map +1 -0
- package/dist/examples/charts-showcase-graph.js +33 -0
- package/dist/examples/charts-showcase-graph.js.map +1 -0
- package/dist/examples/charts-showcase-heatmap.d.ts +2 -0
- package/dist/examples/charts-showcase-heatmap.d.ts.map +1 -0
- package/dist/examples/charts-showcase-heatmap.js +36 -0
- package/dist/examples/charts-showcase-heatmap.js.map +1 -0
- package/dist/examples/charts-showcase-mixed.d.ts +2 -0
- package/dist/examples/charts-showcase-mixed.d.ts.map +1 -0
- package/dist/examples/charts-showcase-mixed.js +30 -0
- package/dist/examples/charts-showcase-mixed.js.map +1 -0
- package/dist/examples/charts-showcase-progress.d.ts +2 -0
- package/dist/examples/charts-showcase-progress.d.ts.map +1 -0
- package/dist/examples/charts-showcase-progress.js +10 -0
- package/dist/examples/charts-showcase-progress.js.map +1 -0
- package/dist/examples/graph-multi-series.js +1 -1
- package/dist/examples/graph-multi-series.js.map +1 -1
- package/dist/examples/horizontal-bar-graph-weekly.d.ts +2 -0
- package/dist/examples/horizontal-bar-graph-weekly.d.ts.map +1 -0
- package/dist/examples/horizontal-bar-graph-weekly.js +67 -0
- package/dist/examples/horizontal-bar-graph-weekly.js.map +1 -0
- package/dist/examples/list-detail-height-ratchet.d.ts +2 -0
- package/dist/examples/list-detail-height-ratchet.d.ts.map +1 -0
- package/dist/examples/list-detail-height-ratchet.js +26 -0
- package/dist/examples/list-detail-height-ratchet.js.map +1 -0
- package/dist/examples/simple-dotted-line-graph.d.ts +2 -0
- package/dist/examples/simple-dotted-line-graph.d.ts.map +1 -0
- package/dist/examples/simple-dotted-line-graph.js +39 -0
- package/dist/examples/simple-dotted-line-graph.js.map +1 -0
- package/dist/examples/simple-histogram.d.ts +2 -0
- package/dist/examples/simple-histogram.d.ts.map +1 -0
- package/dist/examples/simple-histogram.js +47 -0
- package/dist/examples/simple-histogram.js.map +1 -0
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +1 -0
- package/dist/extensions/dev.js.map +1 -1
- package/dist/globals.js +8 -0
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/package-json.d.ts +2 -0
- package/dist/package-json.d.ts.map +1 -1
- package/dist/package-json.js +20 -17
- package/dist/package-json.js.map +1 -1
- package/dist/platform/node/sqlite.d.ts +6 -5
- package/dist/platform/node/sqlite.d.ts.map +1 -1
- package/dist/platform/node/sqlite.js +30 -14
- package/dist/platform/node/sqlite.js.map +1 -1
- package/dist/profiler.d.ts +2 -0
- package/dist/profiler.d.ts.map +1 -0
- package/dist/profiler.js +390 -0
- package/dist/profiler.js.map +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +11 -9
- package/dist/theme.js.map +1 -1
- package/dist/utils/run-command.d.ts.map +1 -1
- package/dist/utils/run-command.js +8 -19
- package/dist/utils/run-command.js.map +1 -1
- package/dist/utils.d.ts +1 -19
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -100
- package/dist/utils.js.map +1 -1
- package/package.json +18 -21
- package/src/build.tsx +38 -15
- package/src/cli.tsx +3 -40
- package/src/compile.tsx +9 -1
- package/src/compile.vitest.tsx +8 -8
- package/src/components/bar-graph.tsx +217 -111
- package/src/components/dotted-line-graph.tsx +407 -0
- package/src/components/extension-preferences.tsx +2 -12
- package/src/components/graph.tsx +5 -1
- package/src/components/histogram.tsx +228 -0
- package/src/components/horizontal-bar-graph.tsx +279 -0
- package/src/components/list.tsx +112 -26
- package/src/examples/action-shortcut.vitest.tsx +20 -20
- package/src/examples/actions-context.vitest.tsx +2 -2
- package/src/examples/bar-graph-weekly.tsx +2 -2
- package/src/examples/bar-graph-weekly.vitest.tsx +103 -102
- package/src/examples/charts-showcase-bargraph.tsx +103 -0
- package/src/examples/detail-metadata-showcase.vitest.tsx +12 -12
- package/src/examples/form-basic.vitest.tsx +11 -11
- package/src/examples/form-dropdown.vitest.tsx +11 -11
- package/src/examples/form-scroll.vitest.tsx +1 -1
- package/src/examples/form-tagpicker.vitest.tsx +11 -11
- package/src/examples/github.vitest.tsx +22 -31
- package/src/examples/graph-bar-chart.vitest.tsx +36 -36
- package/src/examples/graph-multi-series.tsx +1 -1
- package/src/examples/graph-polymarket.vitest.tsx +24 -24
- package/src/examples/graph-row.vitest.tsx +14 -14
- package/src/examples/graph-styles.vitest.tsx +77 -77
- package/src/examples/horizontal-bar-graph-weekly.tsx +138 -0
- package/src/examples/horizontal-bar-graph-weekly.vitest.tsx +164 -0
- package/src/examples/list-detail-height-ratchet.tsx +48 -0
- package/src/examples/list-detail-height-ratchet.vitest.tsx +161 -0
- package/src/examples/list-detail-metadata.vitest.tsx +51 -51
- package/src/examples/list-dropdown-default.vitest.tsx +27 -27
- package/src/examples/list-fetch-data.vitest.tsx +3 -3
- package/src/examples/list-loading-empty-view.vitest.tsx +1 -1
- package/src/examples/list-no-actions.vitest.tsx +3 -3
- package/src/examples/list-scrollbox.vitest.tsx +6 -6
- package/src/examples/list-spacing-mode.vitest.tsx +1 -1
- package/src/examples/list-with-detail.vitest.tsx +55 -55
- package/src/examples/list-with-dropdown.vitest.tsx +6 -6
- package/src/examples/list-with-sections.vitest.tsx +20 -20
- package/src/examples/list-with-toast.vitest.tsx +4 -4
- package/src/examples/simple-candle-chart.vitest.tsx +61 -59
- package/src/examples/simple-dotted-line-graph.tsx +53 -0
- package/src/examples/simple-dotted-line-graph.vitest.tsx +62 -0
- package/src/examples/simple-grid.vitest.tsx +4 -4
- package/src/examples/simple-heatmap.vitest.tsx +9 -9
- package/src/examples/simple-histogram.tsx +90 -0
- package/src/examples/simple-navigation.vitest.tsx +25 -25
- package/src/examples/simple-progress-bar.vitest.tsx +7 -7
- package/src/examples/swift-extension.vitest.tsx +5 -5
- package/src/examples/toast-action.vitest.tsx +4 -4
- package/src/extensions/dev.tsx +2 -1
- package/src/extensions/dev.vitest.tsx +17 -17
- package/src/globals.ts +9 -0
- package/src/index.tsx +21 -0
- package/src/package-json.tsx +24 -23
- package/src/platform/node/sqlite.ts +29 -13
- package/src/profiler.tsx +487 -0
- package/src/theme.tsx +11 -10
- package/src/utils/run-command.tsx +10 -19
- package/src/utils.tsx +0 -163
- package/src/examples/store.tsx +0 -4
- package/src/examples/store.vitest.tsx +0 -78
- package/src/extensions/home.tsx +0 -227
- package/src/extensions/store.tsx +0 -375
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// E2E tests for HorizontalBarGraph stacked horizontal rows and right-side legend.
|
|
2
|
+
|
|
3
|
+
import { afterEach, beforeEach, expect, test } from 'vitest'
|
|
4
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
5
|
+
|
|
6
|
+
let session: Session
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
session = await launchTerminal({
|
|
10
|
+
command: 'bun',
|
|
11
|
+
args: ['src/examples/horizontal-bar-graph-weekly.tsx'],
|
|
12
|
+
cols: 90,
|
|
13
|
+
rows: 30,
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
session?.close()
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
test('renders horizontal stacked rows and compact legend', async () => {
|
|
22
|
+
const text = await session.text({
|
|
23
|
+
waitFor: (content) => {
|
|
24
|
+
return content.includes('Mon') && content.includes('Direct') && content.includes('%')
|
|
25
|
+
},
|
|
26
|
+
timeout: 10000,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
expect(text).toMatchInlineSnapshot(`
|
|
30
|
+
"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
HorizontalBarGraph Showcase ────────────────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
> Search...
|
|
36
|
+
|
|
37
|
+
›Weekl...affi Direct / Org...across 6 days │ category distribution legend
|
|
38
|
+
Revenue by Region Americas / EMEA / APAC │ ──────── ──────────── ───────────────
|
|
39
|
+
Lon...belsThe left label...g legend space │ Mon ╻╻╻╻╻╻╻╻╻╻ ● Direct 42%
|
|
40
|
+
Man...riesLegend grows o... content needs │ Tue ╻╻╻╻╻╻╻╻╻╻ ● Organic 35%
|
|
41
|
+
│ Wed ╻╻╻╻╻ ● Referral 23%
|
|
42
|
+
│ Thu ╻╻╻╻╻
|
|
43
|
+
│ Fri ╻╻╻╻╻╻╻╻╻╻╻╻
|
|
44
|
+
│ Sat ╻╻╻╻╻╻╻╻╻╻
|
|
45
|
+
│
|
|
46
|
+
│
|
|
47
|
+
│
|
|
48
|
+
│
|
|
49
|
+
│
|
|
50
|
+
│
|
|
51
|
+
│
|
|
52
|
+
│
|
|
53
|
+
│
|
|
54
|
+
│
|
|
55
|
+
│
|
|
56
|
+
│
|
|
57
|
+
│
|
|
58
|
+
↵ open detail ↑↓ navigate ^k actions │
|
|
59
|
+
|
|
60
|
+
"
|
|
61
|
+
`)
|
|
62
|
+
expect(text).toContain('Mon')
|
|
63
|
+
expect(text).toContain('Direct')
|
|
64
|
+
expect(text).toContain('╻')
|
|
65
|
+
}, 30000)
|
|
66
|
+
|
|
67
|
+
test('long labels truncate and leave legend visible', async () => {
|
|
68
|
+
await session.text({ waitFor: (content) => content.includes('The left label'), timeout: 10000 })
|
|
69
|
+
session.sendKey('down')
|
|
70
|
+
session.sendKey('down')
|
|
71
|
+
|
|
72
|
+
const text = await session.text({
|
|
73
|
+
waitFor: (content) => {
|
|
74
|
+
return content.includes('›Lon') && content.includes('Views')
|
|
75
|
+
},
|
|
76
|
+
timeout: 10000,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
expect(text).toMatchInlineSnapshot(`
|
|
80
|
+
"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
HorizontalBarGraph Showcase ────────────────────────────────────────────────────────
|
|
84
|
+
|
|
85
|
+
> Search...
|
|
86
|
+
|
|
87
|
+
Weekl...affi Direct / Org...across 6 days │ day traffi source
|
|
88
|
+
Revenue by Region Americas / EMEA / APAC │ ──────────────── ────── ─────────────
|
|
89
|
+
›Lon...belsThe left label...g legend space │ Monday ╻╻╻╻╻ ● Views 65%
|
|
90
|
+
Man...riesLegend grows o... content needs │ Tuesday ╻╻╻╻ ● Clicks 35%
|
|
91
|
+
│ Wednesday ╻╻╻
|
|
92
|
+
│ Thursday ╻╻
|
|
93
|
+
│ Friday ╻╻╻╻╻╻
|
|
94
|
+
│ Saturday & Sund… ╻╻╻╻╻
|
|
95
|
+
│
|
|
96
|
+
│
|
|
97
|
+
│
|
|
98
|
+
│
|
|
99
|
+
│
|
|
100
|
+
│
|
|
101
|
+
│
|
|
102
|
+
│
|
|
103
|
+
│
|
|
104
|
+
│
|
|
105
|
+
│
|
|
106
|
+
│
|
|
107
|
+
│
|
|
108
|
+
↵ open detail ↑↓ navigate ^k actions │
|
|
109
|
+
|
|
110
|
+
"
|
|
111
|
+
`)
|
|
112
|
+
expect(text).toContain('Saturday')
|
|
113
|
+
expect(text).toContain('Views')
|
|
114
|
+
}, 30000)
|
|
115
|
+
|
|
116
|
+
test('many series keeps bars readable and clips legend vertically', async () => {
|
|
117
|
+
await session.text({ waitFor: (content) => content.includes('Legend grows'), timeout: 10000 })
|
|
118
|
+
session.sendKey('down')
|
|
119
|
+
session.sendKey('down')
|
|
120
|
+
session.sendKey('down')
|
|
121
|
+
|
|
122
|
+
const text = await session.text({
|
|
123
|
+
waitFor: (content) => {
|
|
124
|
+
return content.includes('›Man') && content.includes('Series 8')
|
|
125
|
+
},
|
|
126
|
+
timeout: 10000,
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
expect(text).toMatchInlineSnapshot(`
|
|
130
|
+
"
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
HorizontalBarGraph Showcase ────────────────────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
> Search...
|
|
136
|
+
|
|
137
|
+
Weekl...affi Direct / Org...across 6 days │ category distribution legend
|
|
138
|
+
Revenue by Region Americas / EMEA / APAC │ ──────── ──────────── ───────────────
|
|
139
|
+
Lon...belsThe left label...g legend space │ Mon ╻╻╻╻╻╻╻╻ ● Series 8 20%
|
|
140
|
+
›Man...riesLegend grows o... content needs │ Tue ╻╻╻╻╻╻╻ ● Series 7 18%
|
|
141
|
+
│ Wed ╻╻╻╻╻╻ ● Series 6 16%
|
|
142
|
+
│ Thu ╻╻╻╻╻╻ ● Series 5 14%
|
|
143
|
+
│ Fri ╻╻╻╻╻╻╻╻╻╻╻╻ ● Series 4 11%
|
|
144
|
+
│ Sat ╻╻╻╻╻╻╻╻╻ ● Series 3 9%
|
|
145
|
+
│
|
|
146
|
+
│
|
|
147
|
+
│
|
|
148
|
+
│
|
|
149
|
+
│
|
|
150
|
+
│
|
|
151
|
+
│
|
|
152
|
+
│
|
|
153
|
+
│
|
|
154
|
+
│
|
|
155
|
+
│
|
|
156
|
+
│
|
|
157
|
+
│
|
|
158
|
+
↵ open detail ↑↓ navigate ^k actions │
|
|
159
|
+
|
|
160
|
+
"
|
|
161
|
+
`)
|
|
162
|
+
expect(text).toContain('Series 8')
|
|
163
|
+
expect(text).toContain('╻')
|
|
164
|
+
}, 30000)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Example: List with varying detail heights to test the grow-only minHeight
|
|
2
|
+
// ratchet on the detail panel. Navigating from a tall detail to a short one
|
|
3
|
+
// should NOT cause the footer to jump up (no layout shift).
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import { List } from 'termcast'
|
|
6
|
+
import { renderWithProviders } from '../utils'
|
|
7
|
+
|
|
8
|
+
// Generate 25 items with alternating short/tall detail content.
|
|
9
|
+
// Odd-indexed items have tall detail (many lines), even-indexed have short detail.
|
|
10
|
+
const items = Array.from({ length: 25 }, (_, i) => {
|
|
11
|
+
const isTall = i % 2 === 1
|
|
12
|
+
const markdown = isTall
|
|
13
|
+
? [
|
|
14
|
+
`# Item ${i} (tall)`,
|
|
15
|
+
'',
|
|
16
|
+
...Array.from({ length: 12 }, (_, j) => `Line ${j + 1} of detail content for item ${i}.`),
|
|
17
|
+
].join('\n')
|
|
18
|
+
: `# Item ${i} (short)\n\nBrief.`
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
id: `item-${i}`,
|
|
22
|
+
title: `Item ${i}`,
|
|
23
|
+
subtitle: isTall ? 'tall' : 'short',
|
|
24
|
+
markdown,
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
function ListDetailHeightRatchet() {
|
|
29
|
+
return (
|
|
30
|
+
<List
|
|
31
|
+
navigationTitle="Height Ratchet Test"
|
|
32
|
+
searchBarPlaceholder="Search..."
|
|
33
|
+
isShowingDetail={true}
|
|
34
|
+
>
|
|
35
|
+
{items.map((item) => (
|
|
36
|
+
<List.Item
|
|
37
|
+
key={item.id}
|
|
38
|
+
id={item.id}
|
|
39
|
+
title={item.title}
|
|
40
|
+
subtitle={item.subtitle}
|
|
41
|
+
detail={<List.Item.Detail markdown={item.markdown} />}
|
|
42
|
+
/>
|
|
43
|
+
))}
|
|
44
|
+
</List>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
await renderWithProviders(<ListDetailHeightRatchet />)
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// E2E tests for the detail panel grow-only height ratchet.
|
|
2
|
+
// Verifies that the footer does not shift up when navigating from a tall
|
|
3
|
+
// detail item to a short one. The detail panel's minHeight should ratchet
|
|
4
|
+
// upward and never shrink back.
|
|
5
|
+
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
6
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
7
|
+
|
|
8
|
+
let session: Session
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
session = await launchTerminal({
|
|
12
|
+
command: 'bun',
|
|
13
|
+
args: ['src/examples/list-detail-height-ratchet.tsx'],
|
|
14
|
+
cols: 80,
|
|
15
|
+
rows: 30,
|
|
16
|
+
})
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
session?.close()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
function getFooterLineNumber(snapshot: string): number {
|
|
24
|
+
const lines = snapshot.split('\n')
|
|
25
|
+
return lines.findIndex((line) => line.includes('navigate'))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test('detail panel height ratchet prevents footer layout shift', async () => {
|
|
29
|
+
// Item 0 is short detail
|
|
30
|
+
const shortSnapshot = await session.text({
|
|
31
|
+
waitFor: (text) => {
|
|
32
|
+
return text.includes('›Item 0') && text.includes('Brief') && text.includes('navigate')
|
|
33
|
+
},
|
|
34
|
+
timeout: 10000,
|
|
35
|
+
})
|
|
36
|
+
expect(shortSnapshot).toMatchInlineSnapshot(`
|
|
37
|
+
"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Height Ratchet Test ──────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
> Search...
|
|
43
|
+
|
|
44
|
+
›Item 0 short │ Item 0 (short)
|
|
45
|
+
Item 1 tall │
|
|
46
|
+
Item 2 short │
|
|
47
|
+
Item 3 tall │ Brief.
|
|
48
|
+
Item 4 short │
|
|
49
|
+
Item 5 tall │
|
|
50
|
+
Item 6 short │
|
|
51
|
+
Item 7 tall │
|
|
52
|
+
Item 8 short │
|
|
53
|
+
Item 9 tall │
|
|
54
|
+
Item 10 short │
|
|
55
|
+
Item 11 tall │
|
|
56
|
+
Item 12 short │
|
|
57
|
+
Item 13 tall │
|
|
58
|
+
Item 14 short │
|
|
59
|
+
Item 15 tall │
|
|
60
|
+
Item 16 short │
|
|
61
|
+
Item 17 tall │
|
|
62
|
+
Item 18 short │
|
|
63
|
+
│
|
|
64
|
+
│
|
|
65
|
+
↑↓ navigate ^k actions :vim │
|
|
66
|
+
|
|
67
|
+
"
|
|
68
|
+
`)
|
|
69
|
+
|
|
70
|
+
// Navigate to Item 1 (tall detail) to ratchet the height up
|
|
71
|
+
await session.press('down')
|
|
72
|
+
|
|
73
|
+
const tallSnapshot = await session.text({
|
|
74
|
+
waitFor: (text) => {
|
|
75
|
+
return text.includes('›Item 1') && text.includes('Line 1') && text.includes('navigate')
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
expect(tallSnapshot).toMatchInlineSnapshot(`
|
|
79
|
+
"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
Height Ratchet Test ──────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
> Search...
|
|
85
|
+
|
|
86
|
+
Item 0 short │ Item 1 (tall) ▲
|
|
87
|
+
›Item 1 tall │ Line 1 of detail content for item █
|
|
88
|
+
Item 2 short │ 1. █
|
|
89
|
+
Item 3 tall │ Line 2 of detail content for item █
|
|
90
|
+
Item 4 short │ 1. █
|
|
91
|
+
Item 5 tall │ Line 3 of detail content for item █
|
|
92
|
+
Item 6 short │ 1.
|
|
93
|
+
Item 7 tall │ Line 4 of detail content for item
|
|
94
|
+
Item 8 short │ 1.
|
|
95
|
+
Item 9 tall │ Line 5 of detail content for item
|
|
96
|
+
Item 10 short │ 1.
|
|
97
|
+
Item 11 tall │ Line 6 of detail content for item
|
|
98
|
+
Item 12 short │ 1.
|
|
99
|
+
Item 13 tall │ Line 7 of detail content for item
|
|
100
|
+
Item 14 short │ 1.
|
|
101
|
+
Item 15 tall │ Line 8 of detail content for item
|
|
102
|
+
Item 16 short │ 1.
|
|
103
|
+
Item 17 tall │ Line 9 of detail content for item
|
|
104
|
+
Item 18 short │ 1.
|
|
105
|
+
│ Line 10 of detail content for
|
|
106
|
+
│ item 1.
|
|
107
|
+
↑↓ navigate ^k actions :vim │ Line 11 of detail content for ▼
|
|
108
|
+
|
|
109
|
+
"
|
|
110
|
+
`)
|
|
111
|
+
|
|
112
|
+
// Navigate back to Item 0 (short detail).
|
|
113
|
+
// The footer should stay at the same line as the tall snapshot.
|
|
114
|
+
await session.press('up')
|
|
115
|
+
|
|
116
|
+
const backToShortSnapshot = await session.text({
|
|
117
|
+
waitFor: (text) => {
|
|
118
|
+
return text.includes('›Item 0') && text.includes('Brief') && text.includes('navigate')
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
expect(backToShortSnapshot).toMatchInlineSnapshot(`
|
|
122
|
+
"
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
Height Ratchet Test ──────────────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
> Search...
|
|
128
|
+
|
|
129
|
+
›Item 0 short │ Item 0 (short)
|
|
130
|
+
Item 1 tall │ Brief.
|
|
131
|
+
Item 2 short │
|
|
132
|
+
Item 3 tall │
|
|
133
|
+
Item 4 short │
|
|
134
|
+
Item 5 tall │
|
|
135
|
+
Item 6 short │
|
|
136
|
+
Item 7 tall │
|
|
137
|
+
Item 8 short │
|
|
138
|
+
Item 9 tall │
|
|
139
|
+
Item 10 short │
|
|
140
|
+
Item 11 tall │
|
|
141
|
+
Item 12 short │
|
|
142
|
+
Item 13 tall │
|
|
143
|
+
Item 14 short │
|
|
144
|
+
Item 15 tall │
|
|
145
|
+
Item 16 short │
|
|
146
|
+
Item 17 tall │
|
|
147
|
+
Item 18 short │
|
|
148
|
+
│
|
|
149
|
+
│
|
|
150
|
+
↑↓ navigate ^k actions :vim │
|
|
151
|
+
|
|
152
|
+
"
|
|
153
|
+
`)
|
|
154
|
+
|
|
155
|
+
// The key assertion: footer line should not move up when going from tall to short
|
|
156
|
+
const footerLineTall = getFooterLineNumber(tallSnapshot)
|
|
157
|
+
const footerLineBackToShort = getFooterLineNumber(backToShortSnapshot)
|
|
158
|
+
|
|
159
|
+
expect(footerLineBackToShort).toBe(footerLineTall)
|
|
160
|
+
expect(backToShortSnapshot).toContain('navigate')
|
|
161
|
+
}, 20000)
|
|
@@ -48,28 +48,28 @@ test('list detail metadata label renders short values in row layout (key: value)
|
|
|
48
48
|
│
|
|
49
49
|
│ Status: Active
|
|
50
50
|
│
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
51
|
+
│ Website: example.com
|
|
52
|
+
│
|
|
53
|
+
│
|
|
54
|
+
│
|
|
55
|
+
│
|
|
56
|
+
│
|
|
57
|
+
│
|
|
58
|
+
│
|
|
59
|
+
│
|
|
60
|
+
│
|
|
61
|
+
│
|
|
62
|
+
│
|
|
63
|
+
│
|
|
64
|
+
│
|
|
65
|
+
│
|
|
66
|
+
│
|
|
67
|
+
│
|
|
68
|
+
│
|
|
69
|
+
│
|
|
70
|
+
│
|
|
71
|
+
│
|
|
72
|
+
↑↓ navigate ^k actions :vim │
|
|
73
73
|
|
|
74
74
|
"
|
|
75
75
|
`)
|
|
@@ -113,21 +113,21 @@ test('list detail metadata renders long values in column layout (key on one line
|
|
|
113
113
|
│ Short: OK
|
|
114
114
|
│
|
|
115
115
|
│ URL: example.com/very/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
│ long/path
|
|
117
|
+
│
|
|
118
|
+
│
|
|
119
|
+
│
|
|
120
|
+
│
|
|
121
|
+
│
|
|
122
|
+
│
|
|
123
|
+
│
|
|
124
|
+
│
|
|
125
|
+
│
|
|
126
|
+
│
|
|
127
|
+
│
|
|
128
|
+
│
|
|
129
|
+
│
|
|
130
|
+
↑↓ navigate ^k actions :vim │
|
|
131
131
|
|
|
132
132
|
"
|
|
133
133
|
`)
|
|
@@ -157,10 +157,8 @@ test('list detail metadata renders colored values and tag lists', async () => {
|
|
|
157
157
|
> Search...
|
|
158
158
|
|
|
159
159
|
Short Values │ Project Status
|
|
160
|
-
Long Values │
|
|
161
|
-
›Colored & Tags │
|
|
162
|
-
│ Overview of the current project
|
|
163
|
-
│ state.
|
|
160
|
+
Long Values │ Overview of the current project
|
|
161
|
+
›Colored & Tags │ state.
|
|
164
162
|
│
|
|
165
163
|
│ Info
|
|
166
164
|
│
|
|
@@ -178,16 +176,18 @@ test('list detail metadata renders colored values and tag lists', async () => {
|
|
|
178
176
|
│
|
|
179
177
|
│ ──────────────────────────────────
|
|
180
178
|
│
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
│ Repo: github.com/example
|
|
180
|
+
│
|
|
181
|
+
│
|
|
182
|
+
│
|
|
183
|
+
│
|
|
184
|
+
│
|
|
185
|
+
│
|
|
186
|
+
│
|
|
187
|
+
│
|
|
188
|
+
│
|
|
189
|
+
│
|
|
190
|
+
↑↓ navigate ^k actions :vim │
|
|
191
191
|
|
|
192
192
|
"
|
|
193
193
|
`)
|
|
@@ -43,11 +43,11 @@ test('dropdown defaults to first item when no value is provided', async () => {
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
47
46
|
|
|
48
47
|
|
|
49
48
|
|
|
50
49
|
|
|
50
|
+
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
@@ -77,20 +77,22 @@ test('dropdown opens and shows items', async () => {
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
Dropdown Default Value Example ───────────────────────────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
> Search... Apple ▾
|
|
80
82
|
╭──────────────────────────────────────────────────────────────────────────╮
|
|
81
|
-
> Search.│ │ Apple ▾
|
|
82
|
-
│ Filter by category esc │
|
|
83
83
|
›First Ite│ │
|
|
84
|
-
Second It│
|
|
84
|
+
Second It│ Filter by category esc │
|
|
85
85
|
Vegetable│ │
|
|
86
|
-
Carrot Wi│
|
|
86
|
+
Carrot Wi│ > Select category... │
|
|
87
|
+
│ │
|
|
88
|
+
│ ›Apple │
|
|
87
89
|
│ Banana │
|
|
88
90
|
│ Orange │
|
|
89
91
|
│ Grape │
|
|
90
92
|
│ │
|
|
91
|
-
↵ show se│ │mcast.app
|
|
92
|
-
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
93
93
|
│ │
|
|
94
|
+
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
95
|
+
↵ show se│ │mcast.app
|
|
94
96
|
╰──────────────────────────────────────────────────────────────────────────╯
|
|
95
97
|
|
|
96
98
|
|
|
@@ -101,8 +103,6 @@ test('dropdown opens and shows items', async () => {
|
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
|
|
106
106
|
"
|
|
107
107
|
`)
|
|
108
108
|
|
|
@@ -114,20 +114,22 @@ test('dropdown opens and shows items', async () => {
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
Dropdown Default Value Example ───────────────────────────────────────────────────────────────
|
|
117
|
+
|
|
118
|
+
> Search... Apple ▾
|
|
117
119
|
╭──────────────────────────────────────────────────────────────────────────╮
|
|
118
|
-
> Search.│ │ Apple ▾
|
|
119
|
-
│ Filter by category esc │
|
|
120
120
|
›First Ite│ │
|
|
121
|
-
Second It│
|
|
121
|
+
Second It│ Filter by category esc │
|
|
122
122
|
Vegetable│ │
|
|
123
|
-
Carrot Wi│
|
|
123
|
+
Carrot Wi│ > Select category... │
|
|
124
|
+
│ │
|
|
125
|
+
│ Apple │
|
|
124
126
|
│ ›Banana │
|
|
125
127
|
│ Orange │
|
|
126
128
|
│ Grape │
|
|
127
129
|
│ │
|
|
128
|
-
↵ show se│ │mcast.app
|
|
129
|
-
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
130
130
|
│ │
|
|
131
|
+
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
132
|
+
↵ show se│ │mcast.app
|
|
131
133
|
╰──────────────────────────────────────────────────────────────────────────╯
|
|
132
134
|
|
|
133
135
|
|
|
@@ -138,8 +140,6 @@ test('dropdown opens and shows items', async () => {
|
|
|
138
140
|
|
|
139
141
|
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
|
|
143
143
|
"
|
|
144
144
|
`)
|
|
145
145
|
|
|
@@ -162,11 +162,11 @@ test('dropdown opens and shows items', async () => {
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
166
165
|
|
|
167
166
|
|
|
168
167
|
|
|
169
168
|
|
|
169
|
+
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
|
|
@@ -196,20 +196,22 @@ test('clicking dropdown opens it', async () => {
|
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
Dropdown Default Value Example ───────────────────────────────────────────────────────────────
|
|
199
|
+
|
|
200
|
+
> Search... Apple ▾
|
|
199
201
|
╭──────────────────────────────────────────────────────────────────────────╮
|
|
200
|
-
> Search.│ │ Apple ▾
|
|
201
|
-
│ Filter by category esc │
|
|
202
202
|
›First Ite│ │
|
|
203
|
-
Second It│
|
|
203
|
+
Second It│ Filter by category esc │
|
|
204
204
|
Vegetable│ │
|
|
205
|
-
Carrot Wi│
|
|
205
|
+
Carrot Wi│ > Select category... │
|
|
206
|
+
│ │
|
|
207
|
+
│ ›Apple │
|
|
206
208
|
│ Banana │
|
|
207
209
|
│ Orange │
|
|
208
210
|
│ Grape │
|
|
209
211
|
│ │
|
|
210
|
-
↵ show se│ │mcast.app
|
|
211
|
-
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
212
212
|
│ │
|
|
213
|
+
│ ↵ select ↑↓ navigate powered by termcast.app │
|
|
214
|
+
↵ show se│ │mcast.app
|
|
213
215
|
╰──────────────────────────────────────────────────────────────────────────╯
|
|
214
216
|
|
|
215
217
|
|
|
@@ -220,8 +222,6 @@ test('clicking dropdown opens it', async () => {
|
|
|
220
222
|
|
|
221
223
|
|
|
222
224
|
|
|
223
|
-
|
|
224
|
-
|
|
225
225
|
"
|
|
226
226
|
`)
|
|
227
227
|
|
|
@@ -244,11 +244,11 @@ test('clicking dropdown opens it', async () => {
|
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
|
|
247
|
-
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
248
247
|
|
|
249
248
|
|
|
250
249
|
|
|
251
250
|
|
|
251
|
+
↵ show selected fruit ↑↓ navigate ^k actions ^p filter by categorpowered by termcast.app
|
|
252
252
|
|
|
253
253
|
|
|
254
254
|
|