Skip to content

Commit 755eed7

Browse files
committed
ui: remove topbarHeight due to inaccuracy
neither did slot height in flex layout work
1 parent 8d9c21e commit 755eed7

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

ui/app/components/Kani.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { ofetch } from "ofetch";
33
import { URL_MERGE_DIFF, MergeKaniColumns, multiSort, type VecMergeHashKaniList, FILTERS, ProofKind } from "~/shared/utils/kani";
44
import { useStyleStore } from "~/stores/style";
55
6-
const { restHeight } = storeToRefs(useStyleStore());
7-
watch(restHeight, val => console.log(val));
6+
// Compute absolute scrollHeight for DataTable.
7+
const { viewportHeight } = storeToRefs(useStyleStore());
88
99
const raw = ref<VecMergeHashKaniList>([]);
1010
// Download JSON
@@ -29,10 +29,11 @@ useHead({ title: "Verify Rust Std - Kani" });
2929
</script>
3030

3131
<template>
32+
3233
<DataTable :value="raw" paginator :rows="5" :rowsPerPageOptions="[5, 10, 20, 50]" sortMode="multiple" removableSort
33-
v-model:multi-sort-meta="multiSort" stripedRows tableStyle="min-width: 20rem" tableClass="m-2"
34-
:scrollHeight="`${restHeight - 10}px`" v-model:filters="filters" :globalFilterFields="FILTERS.fields"
35-
currentPageReportTemplate="{first} to {last} of {totalRecords}">
34+
v-model:multi-sort-meta="multiSort" stripedRows tableStyle="min-width: 20rem" tableClass="m-1"
35+
:scrollHeight="`${Math.round(viewportHeight * 0.78)}px`" v-model:filters="filters"
36+
:globalFilterFields="FILTERS.fields" currentPageReportTemplate="{first} to {last} of {totalRecords}">
3637

3738
<template #header>
3839
<div class="flex justify-between items-center">

ui/app/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (localStorage.getItem(KEY) === DARK) {
2121

2222
<template>
2323
<div>
24-
<div class="flex justify-between p-2" id="topbar">
24+
<div class="flex justify-between p-2">
2525
<div></div>
2626
<div>
2727
<Button :icon='dark ? "pi pi-sun" : "pi pi-moon"' @click="toggleTheme" severity="contrast" raised />

ui/app/stores/style.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ export const useStyleStore = defineStore("style", () => {
44
topButton: "white", orange: "orange", orange_light: "orange",
55
});
66
const viewportHeight = ref(800);
7-
const topbarHeight = ref(800);
8-
const restHeight = computed(() => viewportHeight.value - topbarHeight.value);
97

108
onMounted(() => {
119
// Get styles after computation.
@@ -21,14 +19,11 @@ export const useStyleStore = defineStore("style", () => {
2119

2220
// Get heights
2321
viewportHeight.value = window.innerHeight;
24-
topbarHeight.value = document.getElementById("topbar")?.offsetHeight ?? 800;
2522
window.addEventListener("resize", () => {
2623
viewportHeight.value = window.innerHeight;
27-
topbarHeight.value = document.getElementById("topbar")?.offsetHeight ?? 800;
2824
});
29-
3025
});
3126

32-
return { color, viewportHeight, topbarHeight, restHeight }
27+
return { color, viewportHeight }
3328
});
3429

0 commit comments

Comments
 (0)