Skip to content

Commit 0b4addb

Browse files
committed
Merge branch 'app' into jsklan/weekly-selfhosted-publish
2 parents e2eeb7e + 286f721 commit 0b4addb

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed

packages/fern-dashboard/next.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { withSentryConfig } from "@sentry/nextjs";
66
const CSP_HEADER = `
77
default-src 'self';
88
script-src 'self' 'unsafe-inline' 'unsafe-eval' *.usepylon.com *.posthog.com *.pusher.com d3vl36l12sfx26.cloudfront.net cdn.jsdelivr.net va.vercel-scripts.com;
9+
worker-src 'self' blob:;
910
connect-src 'self' * ws:;
1011
style-src 'self' 'unsafe-inline' *.usepylon.com *.posthog.com cdn.jsdelivr.net cdnjs.cloudflare.com;
11-
font-src 'self' pylon-avatars.s3.us-west-1.amazonaws.com *.usepylon.com *.buildwithfern.com;
12+
font-src 'self' pylon-avatars.s3.us-west-1.amazonaws.com *.usepylon.com *.buildwithfern.com cdn.jsdelivr.net;
1213
img-src 'self' *;
1314
frame-src 'self' *;
1415
object-src 'self' *;

packages/fern-dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"sideEffects": false,
1111
"scripts": {
12-
"clean": "rm -rf ./lib ./dist && tsc --build --clean",
12+
"clean": "rm -rf ./lib ./dist ./.next && tsc --build --clean",
1313
"compile": "tsc --build",
1414
"dashboard:build": "next build",
1515
"dashboard:dev": "next dev",

packages/fern-dashboard/src/components/login-page/logos/Auth0Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function Auth0Logo() {
77
fill="none"
88
xmlns="http://www.w3.org/2000/svg"
99
>
10-
<g clip-path="url(#clip0_2202_23306)">
10+
<g clipPath="url(#clip0_2202_23306)">
1111
<path
1212
d="M13.2351 0.25H7.41318L9.22558 5.88815H15.0475L10.3455 9.25728L12.1579 14.9298C15.1757 12.721 16.1674 9.35182 15.056 5.89674L13.2351 0.25ZM-0.186892 5.88815H5.63499L7.44738 0.25H1.59985L-0.186892 5.88815C-1.29826 9.34323 -0.332225 12.7124 2.71122 14.9212L4.52362 9.24869L-0.186892 5.88815ZM2.71122 14.9212L7.41318 18.256L12.1151 14.9212L7.41318 11.4919L2.71122 14.9212ZM46.6446 5.76782C45.2597 5.76782 44.3791 6.40383 43.9602 7.40082H43.8662V2.75966H41.8144V14.8868H43.926V9.61826C43.926 8.31186 44.7382 7.55552 45.8581 7.55552C46.978 7.55552 47.6107 8.28608 47.6107 9.49793V14.8954H49.7223V9.13696C49.7223 6.97968 48.5169 5.76782 46.6446 5.76782ZM55.4501 2.73388C52.5862 2.73388 50.8678 4.9771 50.8678 8.88771C50.8678 12.7983 52.5605 15.1017 55.4501 15.1017C58.314 15.1017 60.0324 12.8241 60.0324 8.88771C60.0324 4.95132 58.3226 2.73388 55.4501 2.73388ZM53.0393 8.88771C53.0393 6.03426 53.9711 4.55596 55.4501 4.55596C56.476 4.55596 57.2027 5.25214 57.5874 6.58432L53.0906 9.85891C53.0393 9.58388 53.0393 9.25728 53.0393 8.88771ZM55.4501 13.2538C54.4242 13.2538 53.6377 12.5233 53.2787 11.0708L57.8011 7.77039C57.8353 8.13137 57.8609 8.52673 57.8609 8.8963C57.8695 11.7669 56.9291 13.2538 55.4501 13.2538ZM32.2908 11.1052C32.2908 12.4717 31.3248 13.1335 30.3929 13.1335C29.4611 13.1335 28.7002 12.403 28.7002 11.2856V5.86236H26.5886V11.5951C26.5886 13.7781 27.8282 14.99 29.5722 14.99C30.8973 14.99 31.8634 14.2594 32.2566 13.2624H32.3507V14.861H34.4024V5.86236H32.2908V11.1052ZM21.8012 5.73344C19.9033 5.73344 18.4842 6.58432 18.0054 8.21732L19.9631 8.49235C20.1769 7.85634 20.7753 7.34066 21.8012 7.34066C22.8271 7.34066 23.3058 7.82196 23.3058 8.733V8.76738C23.3058 9.37761 22.6732 9.40339 21.1087 9.58388C19.5442 9.76437 17.6976 10.3144 17.6976 12.3428C17.6976 14.1047 18.9971 15.0415 20.7155 15.0415C22.1004 15.0415 22.9467 14.3711 23.34 13.6148H23.3998V14.861H25.4174V8.82755C25.4516 6.46399 23.5195 5.73344 21.8012 5.73344ZM23.34 11.6466C23.34 12.6436 22.5278 13.4945 21.2626 13.4945C20.3906 13.4945 19.758 13.0991 19.758 12.3084C19.758 11.5177 20.4846 11.1567 21.4165 11.002C21.9551 10.9075 23.075 10.7871 23.3485 10.5465V11.6466H23.34ZM38.9249 3.61914H36.8132V5.89674H35.5138V7.55552H36.8132V12.5577C36.8132 14.2594 38.0187 15.0759 39.6173 15.0415C39.9764 15.0415 40.344 14.9814 40.7031 14.8868V13.228C40.5492 13.2624 40.1645 13.2882 39.8909 13.3226C39.3523 13.3226 38.9249 13.1421 38.9249 12.2912V7.55552H40.6774V5.88815H38.9249V3.61914Z"
1313
fill="#8B8D98"

packages/fern-dashboard/src/components/theme/ThemeToggle.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useTheme } from "next-themes";
4-
import * as React from "react";
4+
import React, { useLayoutEffect, useState } from "react";
55

66
import { Monitor, Moon, Sun } from "lucide-react";
77

@@ -16,6 +16,16 @@ import {
1616
export function ThemeToggle() {
1717
const { theme, setTheme } = useTheme();
1818

19+
/**
20+
* Prevent hydration mismatch by deferring theme-dependent rendering until after mount.
21+
* Server cannot access localStorage/user preferences, so theme is undefined during SSR,
22+
* but has actual value on client after hydration.
23+
*/
24+
const [hasMounted, setHasMounted] = useState(false);
25+
const mountedTheme = hasMounted && theme ? theme : "system";
26+
27+
useLayoutEffect(() => setHasMounted(true), []);
28+
1929
return (
2030
<DropdownMenu>
2131
<DropdownMenuTrigger asChild>
@@ -24,9 +34,15 @@ export function ThemeToggle() {
2434
variant="ghost"
2535
className="w-fit justify-start px-0 text-left hover:px-2 has-[>svg]:px-0 hover:has-[>svg]:px-2 md:w-8 md:justify-center"
2636
>
27-
{theme === "light" && <Sun className="h-[1.2rem] w-[1.2rem]" />}
28-
{theme === "dark" && <Moon className="h-[1.2rem] w-[1.2rem]" />}
29-
{theme === "system" && <Monitor className="h-[1.2rem] w-[1.2rem]" />}
37+
{mountedTheme === "light" && (
38+
<Sun className="h-[1.2rem] w-[1.2rem]" />
39+
)}
40+
{mountedTheme === "dark" && (
41+
<Moon className="h-[1.2rem] w-[1.2rem]" />
42+
)}
43+
{mountedTheme === "system" && (
44+
<Monitor className="h-[1.2rem] w-[1.2rem]" />
45+
)}
3046
<span className="sr-only">Toggle theme</span>
3147
<span className="block md:hidden">Theme</span>
3248
</Button>

packages/fern-docs/components/src/theming/AbstractDefaultDocs.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useTheme } from "next-themes";
4-
import React from "react";
4+
import React, { Fragment } from "react";
55

66
import { Separator } from "../Separator";
77
import { cn } from "../cn";
@@ -89,7 +89,7 @@ export default function AbstractDefaultDocs({
8989
{announcement}
9090
<div className="width-before-scroll-bar">
9191
<div className="fern-header-content">{header}</div>
92-
{headerTabs}
92+
<Fragment key="header-tabs">{headerTabs}</Fragment>
9393
</div>
9494
</FernHeader>
9595

@@ -134,7 +134,6 @@ export default function AbstractDefaultDocs({
134134
hidden: !hasProductsOrVersions,
135135
})}
136136
/>
137-
138137
{sidebar}
139138
</SidebarNav>
140139
{children}

servers/fai/src/fai/routes/slack.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async def handle_draft_reply_action(payload: dict[str, Any]) -> JSONResponse:
309309
try:
310310
trigger_id = payload.get("trigger_id")
311311
user = payload.get("user", {})
312-
user_id = user.get("id")
312+
user.get("id")
313313
team = payload.get("team", {})
314314
team_id = team.get("id")
315315
channel = payload.get("channel", {})
@@ -612,15 +612,14 @@ async def get_slack_install_link(domain: str) -> JSONResponse:
612612
integration_id = integration.integration_id
613613
LOGGER.info(f"Using existing integration {integration_id} for domain {domain}")
614614
else:
615-
from uuid import uuid4
616-
617-
integration_id = str(uuid4())
618615
new_integration = SlackIntegrationDb(
619-
integration_id=integration_id,
620616
domain=domain,
617+
created_at=datetime.now(UTC),
621618
)
622619
session.add(new_integration)
623620
await session.commit()
621+
await session.refresh(new_integration)
622+
integration_id = new_integration.integration_id
624623
LOGGER.info(f"Created new integration {integration_id} for domain {domain}")
625624

626625
scopes = [

0 commit comments

Comments
 (0)