Skip to content

Commit e70815e

Browse files
fix: elipsis on long table items
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
1 parent 7adddbb commit e70815e

File tree

7 files changed

+34
-6
lines changed

7 files changed

+34
-6
lines changed

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
3+
[target.x86_64-unknown-linux-musl]
4+
rustflags=["-C", "target_cpu=x86-64v2"]

src/app/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(super) fn init_duckdb(
3131

3232
{
3333
let conn = pool.get()?;
34-
conn.execute("PRAGMA enable_checkpoint_on_shutdown; LOAD core_functions;", [])?;
34+
conn.execute_batch("PRAGMA enable_checkpoint_on_shutdown; LOAD core_functions;")?;
3535
conn.pragma_update(None, "allow_community_extensions", &"false")?;
3636
conn.pragma_update(None, "autoinstall_known_extensions", &"false")?;
3737
conn.pragma_update(None, "autoload_known_extensions", &"false")?;

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn handle_command(mut config: Config, cmd: Command) -> Result<()> {
133133
#[cfg(any(debug_assertions, test, feature = "_enable_seeding"))]
134134
Command::SeedDatabase(_) => {
135135
let app = Liwan::try_new(config)?;
136-
app.seed_database(100000)?;
136+
app.seed_database(10_000_000)?;
137137
println!("Database seeded with test data");
138138
}
139139
}

web/astro.config.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import path from "node:path";
22
import react from "@astrojs/react";
33
import { defineConfig } from "astro/config";
44
import license from "rollup-plugin-license";
5+
import type { AstroIntegration } from "astro";
56
const dirname = path.dirname(new URL(import.meta.url).pathname);
67

78
const proxy = {
@@ -12,6 +13,23 @@ const proxy = {
1213
},
1314
};
1415

16+
function setPrerender(): AstroIntegration {
17+
let isDev = false;
18+
return {
19+
name: "set-prerender",
20+
hooks: {
21+
"astro:config:setup": ({ command }) => {
22+
isDev = command === "dev";
23+
},
24+
"astro:route:setup": ({ route }) => {
25+
if (isDev && route.component.endsWith("/pages/p/[...project].astro")) {
26+
route.prerender = false;
27+
}
28+
},
29+
},
30+
};
31+
}
32+
1533
// https://astro.build/config
1634
export default defineConfig({
1735
vite: {
@@ -30,7 +48,7 @@ export default defineConfig({
3048
}) as any,
3149
],
3250
},
33-
integrations: [react()],
51+
integrations: [react(), setPrerender()],
3452
redirects: {
3553
"/settings": "/settings/projects",
3654
},

web/src/components/dimensions/dimensions.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
display: flex;
5555
align-items: center;
5656
gap: 0.4rem;
57+
width: 0;
5758

5859
&:hover {
5960
&::after {
@@ -154,6 +155,13 @@
154155
position: relative;
155156
color: var(--pico-h2-color);
156157
padding: 0.5rem 0;
158+
max-width: calc(100% - 3rem);
159+
overflow: hidden;
160+
text-overflow: ellipsis;
161+
162+
span {
163+
white-space: nowrap;
164+
}
157165

158166
&:hover {
159167
text-decoration: underline;

web/src/components/dimensions/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const DimensionValueButton = ({
177177
onSelect?: () => void;
178178
}) => (
179179
<button type="button" className={styles.dimensionItemSelect} onClick={onSelect}>
180-
{children}
180+
<span>{children}</span>
181181
</button>
182182
);
183183

web/src/pages/p/[...project].astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import Layout from "../../layouts/Layout.astro";
77
export const getStaticPaths = (() => {
88
return [{ params: { project: "project" } }];
99
}) satisfies GetStaticPaths;
10-
11-
export const prerender = import.meta.env.MODE !== "development";
1210
---
1311

1412
<Layout title="Project Details">

0 commit comments

Comments
 (0)