Skip to content

Commit 12d25b0

Browse files
committed
Fix unit selection
1 parent f02aee7 commit 12d25b0

File tree

5 files changed

+62
-52
lines changed

5 files changed

+62
-52
lines changed

pages/columns/@column/column-inspector/index.ts

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -348,61 +348,67 @@ function ColumnPageInner({ columnInfo, linkPrefix = "/", projectID }) {
348348
h("div.main", [
349349
// This is probably too high in the page hierarchy
350350
h(ErrorBoundary, [
351-
h(MacrostratColumnStateProvider, { units }, [
352-
h("div.left-column", [
353-
h("div.column-header", [
354-
h("nav", [
355-
h(PageBreadcrumbs, {
356-
showLogo: true,
357-
title: columnInfo.col_name,
358-
}),
351+
h(
352+
MacrostratColumnStateProvider,
353+
{
354+
units,
355+
onUnitSelected: setSelectedUnitID,
356+
selectedUnit: selectedUnitID,
357+
},
358+
[
359+
h("div.left-column", [
360+
h("div.column-header", [
361+
h("nav", [
362+
h(PageBreadcrumbs, {
363+
showLogo: true,
364+
title: columnInfo.col_name,
365+
}),
366+
]),
367+
]),
368+
h("div.column-view", [
369+
h(
370+
Column,
371+
{
372+
/** TODO: we ideally would not have to force a re-render like this.
373+
* It is very expensive given the complexity of the column view.
374+
* However, not doing this results in artifacts (particularly with
375+
* label rendering) when columns are switched.
376+
*/
377+
units,
378+
unitComponent: ColoredUnitComponent,
379+
unconformityLabels: "minimal",
380+
collapseSmallUnconformities: true,
381+
showTimescale,
382+
axisType,
383+
columnWidth: 300,
384+
width: 450,
385+
maxInternalColumns,
386+
showLabelColumn,
387+
hybridScale,
388+
pixelScale,
389+
t_age: t_age ?? 0,
390+
b_age: b_age ?? 4500,
391+
t_pos,
392+
b_pos,
393+
},
394+
children
395+
),
359396
]),
360397
]),
361-
h("div.column-view", [
362-
h(
363-
Column,
364-
{
365-
/** TODO: we ideally would not have to force a re-render like this.
366-
* It is very expensive given the complexity of the column view.
367-
* However, not doing this results in artifacts (particularly with
368-
* label rendering) when columns are switched.
369-
*/
370-
units,
371-
unitComponent: ColoredUnitComponent,
372-
unconformityLabels: "minimal",
373-
collapseSmallUnconformities: true,
374-
showTimescale,
375-
axisType,
376-
columnWidth: 300,
377-
width: 450,
378-
onUnitSelected: setSelectedUnitID,
379-
selectedUnit: selectedUnitID,
380-
maxInternalColumns,
381-
showLabelColumn,
382-
hybridScale,
383-
pixelScale,
384-
t_age: t_age ?? 0,
385-
b_age: b_age ?? 4500,
386-
t_pos,
387-
b_pos,
388-
},
389-
children
390-
),
391-
]),
392-
]),
393-
h("div.right-column", [
394-
h("div.right-column-boxes", [
395-
h(ColumnMap, {
396-
className: "column-map",
397-
inProcess: true,
398-
projectID,
399-
selectedColumn: columnInfo.col_id,
400-
onSelectColumn,
401-
}),
402-
assistantContent,
398+
h("div.right-column", [
399+
h("div.right-column-boxes", [
400+
h(ColumnMap, {
401+
className: "column-map",
402+
inProcess: true,
403+
projectID,
404+
selectedColumn: columnInfo.col_id,
405+
onSelectColumn,
406+
}),
407+
assistantContent,
408+
]),
403409
]),
404-
]),
405-
]),
410+
]
411+
),
406412
]),
407413
]),
408414
]);

src/_utils/fetch-helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ async function fetchWrapper(url: string): Promise<Response> {
5656
console.log(
5757
`Fetching ${url} - status ${res.status} - ${duration.toFixed(2)} ms`
5858
);
59+
const cacheStatus = res.headers.get("x-cache");
60+
if (cacheStatus != null) {
61+
console.log(`Cache: ${cacheStatus}`);
62+
}
5963
}
6064
return res;
6165
} catch (error) {

0 commit comments

Comments
 (0)