Skip to content

Commit fcdd35e

Browse files
authored
Merge pull request #43 from odefun/ode_1770389734.193579
fix: restore local-setting slack detail deep links
2 parents 1f49665 + 659a302 commit fcdd35e

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"setup": "bun install --concurrent-scripts=1 --network-concurrency=8 && bun install --concurrent-scripts=1 --network-concurrency=8 --cwd packages/web-ui",
1010
"start": "bun run packages/core/index.ts",
1111
"dev": "bun --watch run packages/core/index.ts --local",
12+
"web:dev": "sh -c 'bun --watch run packages/core/index.ts --local & bun --cwd packages/web-ui run dev; kill 0'",
1213
"postinstall": "bun install --cwd packages/web-ui",
1314
"test:ci": "bun run setup && bun test",
1415
"build:web": "bun --cwd packages/web-ui build && bun run embed:web",

packages/web-ui/src/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ main {
6969
min-height: 100vh;
7070
padding: 6vh 7vw;
7171
display: flex;
72-
align-items: center;
72+
align-items: flex-start;
7373
justify-content: center;
7474
}
7575

packages/web-ui/src/routes/local-setting/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
$: activeSection =
5656
pathname.startsWith("/local-setting/agent")
5757
? "agent"
58-
: pathname.startsWith("/local-setting/slack-bot/")
58+
: pathname.startsWith("/local-setting/slack-bot")
5959
? "slack"
6060
: "profile";
6161
$: enabledProviders = (Object.keys(providerLabels) as AgentProvider[]).filter((provider) => {
@@ -79,8 +79,10 @@
7979
8080
function getSelectedWorkspace(currentPathname: string): DashboardConfig["workspaces"][number] | null {
8181
if (!config.workspaces.length) return null;
82-
if (!currentPathname.startsWith("/local-setting/slack-bot/")) return config.workspaces[0] ?? null;
83-
const slug = currentPathname.split("/").filter(Boolean)[2];
82+
if (!currentPathname.startsWith("/local-setting/slack-bot")) return config.workspaces[0] ?? null;
83+
const [withoutQuery] = currentPathname.split("?");
84+
const segments = withoutQuery.split("/").filter(Boolean);
85+
const slug = decodeURIComponent(segments[2] ?? "");
8486
if (!slug) return config.workspaces[0] ?? null;
8587
return (
8688
config.workspaces.find((workspace) => slugify(workspace.name) === slug || workspace.id === slug) ??

packages/web-ui/src/routes/local-setting/agent/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
export let data: { config: DashboardConfig } | undefined = undefined;
66
</script>
77

8-
<LocalSettingPage {data} />
8+
<LocalSettingPage {data} initialSection="agent" />

packages/web-ui/src/routes/local-setting/profile/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
export let data: { config: DashboardConfig } | undefined = undefined;
66
</script>
77

8-
<LocalSettingPage {data} />
8+
<LocalSettingPage {data} initialSection="profile" />
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<script lang="ts">
22
import LocalSettingPage from "../../+page.svelte";
3+
import { page } from "$app/stores";
34
import type { DashboardConfig } from "$lib/localConfig";
45
56
export let data: { config: DashboardConfig } | undefined = undefined;
67
</script>
78

8-
<LocalSettingPage {data} />
9+
<LocalSettingPage {data} initialSection="slack" initialSlug={$page.params.workspace ?? null} />

0 commit comments

Comments
 (0)