@@ -34,6 +34,8 @@ pub fn time_panel_two_sections_should_match_snapshot() {
34
34
run_time_panel_and_save_snapshot (
35
35
test_context,
36
36
TimePanel :: default ( ) ,
37
+ 300.0 ,
38
+ false ,
37
39
"time_panel_two_sections" ,
38
40
) ;
39
41
}
@@ -69,42 +71,13 @@ pub fn time_panel_dense_data_should_match_snapshot() {
69
71
builder
70
72
} ) ;
71
73
72
- run_time_panel_and_save_snapshot ( test_context, TimePanel :: default ( ) , "time_panel_dense_data" ) ;
73
- }
74
-
75
- fn run_time_panel_and_save_snapshot (
76
- mut test_context : TestContext ,
77
- mut time_panel : TimePanel ,
78
- snapshot_name : & str ,
79
- ) {
80
- let mut harness = test_context
81
- . setup_kittest_for_rendering ( )
82
- . with_size ( Vec2 :: new ( 700.0 , 300.0 ) )
83
- . build_ui ( |ui| {
84
- test_context. run ( & ui. ctx ( ) . clone ( ) , |viewer_ctx| {
85
- let blueprint = ViewportBlueprint :: try_from_db (
86
- viewer_ctx. store_context . blueprint ,
87
- & LatestAtQuery :: latest ( blueprint_timeline ( ) ) ,
88
- ) ;
89
-
90
- let mut time_ctrl = viewer_ctx. rec_cfg . time_ctrl . read ( ) . clone ( ) ;
91
-
92
- time_panel. show_expanded_with_header (
93
- viewer_ctx,
94
- & blueprint,
95
- viewer_ctx. recording ( ) ,
96
- & mut time_ctrl,
97
- ui,
98
- ) ;
99
-
100
- * viewer_ctx. rec_cfg . time_ctrl . write ( ) = time_ctrl;
101
- } ) ;
102
-
103
- test_context. handle_system_commands ( ) ;
104
- } ) ;
105
-
106
- harness. run ( ) ;
107
- harness. snapshot ( snapshot_name) ;
74
+ run_time_panel_and_save_snapshot (
75
+ test_context,
76
+ TimePanel :: default ( ) ,
77
+ 300.0 ,
78
+ false ,
79
+ "time_panel_dense_data" ,
80
+ ) ;
108
81
}
109
82
110
83
// ---
@@ -159,7 +132,7 @@ pub fn run_time_panel_filter_tests(filter_active: bool, query: &str, snapshot_na
159
132
time_panel. activate_filter ( query) ;
160
133
}
161
134
162
- run_time_panel_and_save_snapshot ( test_context, time_panel, snapshot_name) ;
135
+ run_time_panel_and_save_snapshot ( test_context, time_panel, 300.0 , false , snapshot_name) ;
163
136
}
164
137
165
138
// --
@@ -175,7 +148,7 @@ pub fn test_various_entity_kinds_in_time_panel() {
175
148
for time in [ 0 , 5 , i64:: MAX ] {
176
149
let mut test_context = TestContext :: default ( ) ;
177
150
178
- log_all_data ( & mut test_context) ;
151
+ log_data_for_various_entity_kinds_tests ( & mut test_context) ;
179
152
180
153
test_context
181
154
. recording_config
@@ -194,16 +167,18 @@ pub fn test_various_entity_kinds_in_time_panel() {
194
167
195
168
let time_panel = TimePanel :: default ( ) ;
196
169
197
- run_expanded_time_panel_and_save_snapshot (
170
+ run_time_panel_and_save_snapshot (
198
171
test_context,
199
172
time_panel,
173
+ 1200.0 ,
174
+ true ,
200
175
& format ! ( "various_entity_kinds_{timeline}_{time}" ) ,
201
176
) ;
202
177
}
203
178
}
204
179
}
205
180
206
- pub fn log_all_data ( test_context : & mut TestContext ) {
181
+ pub fn log_data_for_various_entity_kinds_tests ( test_context : & mut TestContext ) {
207
182
let timeline_a = "timeline_a" ;
208
183
let timeline_b = "timeline_b" ;
209
184
@@ -267,23 +242,27 @@ pub fn log_static_data(test_context: &mut TestContext, entity_path: impl Into<En
267
242
} ) ;
268
243
}
269
244
270
- fn run_expanded_time_panel_and_save_snapshot (
245
+ fn run_time_panel_and_save_snapshot (
271
246
mut test_context : TestContext ,
272
247
mut time_panel : TimePanel ,
248
+ height : f32 ,
249
+ expand_all : bool ,
273
250
snapshot_name : & str ,
274
251
) {
275
252
let mut harness = test_context
276
253
. setup_kittest_for_rendering ( )
277
- . with_size ( Vec2 :: new ( 700.0 , 1200.0 ) )
254
+ . with_size ( Vec2 :: new ( 700.0 , height ) )
278
255
. build_ui ( |ui| {
279
256
test_context. run ( & ui. ctx ( ) . clone ( ) , |viewer_ctx| {
280
- re_context_menu:: collapse_expand:: collapse_expand_instance_path (
281
- viewer_ctx,
282
- viewer_ctx. recording ( ) ,
283
- & InstancePath :: entity_all ( "/" . into ( ) ) ,
284
- CollapseScope :: StreamsTree ,
285
- true ,
286
- ) ;
257
+ if expand_all {
258
+ re_context_menu:: collapse_expand:: collapse_expand_instance_path (
259
+ viewer_ctx,
260
+ viewer_ctx. recording ( ) ,
261
+ & InstancePath :: entity_all ( "/" . into ( ) ) ,
262
+ CollapseScope :: StreamsTree ,
263
+ true ,
264
+ ) ;
265
+ }
287
266
288
267
let blueprint = ViewportBlueprint :: try_from_db (
289
268
viewer_ctx. store_context . blueprint ,
0 commit comments