fix: minor type and ui fixes, fix solid reactivity warning
This commit is contained in:
parent
cd4c5095e5
commit
82413a8212
4 changed files with 47 additions and 35 deletions
|
@ -191,8 +191,8 @@ function showTooltip(context: ChartContext) {
|
||||||
const pos = context.chart.canvas.getBoundingClientRect();
|
const pos = context.chart.canvas.getBoundingClientRect();
|
||||||
el.style.opacity = "1";
|
el.style.opacity = "1";
|
||||||
el.style.position = "absolute";
|
el.style.position = "absolute";
|
||||||
el.style.left = `${pos.left + window.scrollX + model.caretX}px`;
|
el.style.left = `${(pos.left + window.scrollX + model.caretX).toString()}px`;
|
||||||
el.style.top = `${pos.top + window.scrollY + model.caretY}px`;
|
el.style.top = `${(pos.top + window.scrollY + model.caretY).toString()}px`;
|
||||||
el.style.pointerEvents = "none";
|
el.style.pointerEvents = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { type Accessor, createEffect, createMemo, createSignal, DEV, type Setter } from "solid-js";
|
import { type Accessor, createEffect, createMemo, createRoot, createSignal, DEV, type Setter } from "solid-js";
|
||||||
|
|
||||||
import { Kysely, type NotNull, sql } from "kysely";
|
import { Kysely, type NotNull, sql } from "kysely";
|
||||||
import type { DB } from "kysely-codegen";
|
import type { DB } from "kysely-codegen";
|
||||||
|
@ -41,6 +41,7 @@ const sqlJsDialect = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const kyselyDb = createRoot(() => {
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
const db = rawDb();
|
const db = rawDb();
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@ createEffect(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const kyselyDb = createMemo(() => {
|
return createMemo(() => {
|
||||||
const currentSqlJsDialect = sqlJsDialect();
|
const currentSqlJsDialect = sqlJsDialect();
|
||||||
|
|
||||||
if (!currentSqlJsDialect) {
|
if (!currentSqlJsDialect) {
|
||||||
|
@ -62,6 +63,7 @@ const kyselyDb = createMemo(() => {
|
||||||
dialect: currentSqlJsDialect,
|
dialect: currentSqlJsDialect,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const allThreadsOverviewQueryRaw = kyselyDb()
|
const allThreadsOverviewQueryRaw = kyselyDb()
|
||||||
.selectFrom("thread")
|
.selectFrom("thread")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { createEffect, on } from "solid-js";
|
import { createEffect, createRoot, on } from "solid-js";
|
||||||
|
|
||||||
const DATABASE_HASH_PREFIX = "database";
|
const DATABASE_HASH_PREFIX = "database";
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ const HASH_STORE_KEY = "database_hash";
|
||||||
|
|
||||||
// cannot import `db` the normal way because this file is imported in ~/db.ts before the initialisation of `db` has happened
|
// cannot import `db` the normal way because this file is imported in ~/db.ts before the initialisation of `db` has happened
|
||||||
queueMicrotask(() => {
|
queueMicrotask(() => {
|
||||||
|
createRoot(() => {
|
||||||
void import("~/db").then(({ db }) => {
|
void import("~/db").then(({ db }) => {
|
||||||
createEffect(
|
createEffect(
|
||||||
on(db, (currentDb) => {
|
on(db, (currentDb) => {
|
||||||
|
@ -51,6 +52,7 @@ queueMicrotask(() => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
class LocalStorageCacheAdapter {
|
class LocalStorageCacheAdapter {
|
||||||
keys = new Set<string>(Object.keys(localStorage).filter((key) => key.startsWith(this.prefix)));
|
keys = new Set<string>(Object.keys(localStorage).filter((key) => key.startsWith(this.prefix)));
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { type Accessor, type Component, createEffect, createResource, Show } from "solid-js";
|
import { type Accessor, type Component, createResource, Show } from "solid-js";
|
||||||
import type { RouteSectionProps } from "@solidjs/router";
|
import type { RouteSectionProps } from "@solidjs/router";
|
||||||
|
|
||||||
import { type ChartData } from "chart.js";
|
import { type ChartData } from "chart.js";
|
||||||
|
@ -175,6 +175,14 @@ export const DmId: Component<RouteSectionProps> = (props) => {
|
||||||
<WordCloudChart
|
<WordCloudChart
|
||||||
options={{
|
options={{
|
||||||
normalized: true,
|
normalized: true,
|
||||||
|
plugins: {
|
||||||
|
tooltip: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
data={currentMostUsedWordChartData()}
|
data={currentMostUsedWordChartData()}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue