From e6a3d7e5bb98a59193e85fc7492bb3ab7587f336 Mon Sep 17 00:00:00 2001 From: celine Date: Mon, 6 Apr 2026 20:48:18 -0400 Subject: [PATCH 1/3] fix selected block focus state --- app/globals.css | 14 ++++++++++---- components/Blocks/TextBlock/index.tsx | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/globals.css b/app/globals.css index c86b2665..de5e0ecd 100644 --- a/app/globals.css +++ b/app/globals.css @@ -362,11 +362,15 @@ pre.shiki { } .selection-highlight { - background-color: Highlight; + background-color: transparent; @apply py-[1.5px]; } -.ProseMirror:focus-within .selection-highlight { +.block-focused .selection-highlight { + background-color: Highlight; +} + +.block-focused:focus-within .selection-highlight { background-color: transparent; } @@ -392,7 +396,7 @@ pre.shiki { white-space: normal; } -.multiselected:focus-within .selection-highlight { +.multiselected .block-focused:focus-within .selection-highlight { background-color: transparent; } @@ -604,7 +608,9 @@ pre.shiki { max-height: calc(4.5em + 8px); opacity: calc(var(--bg-page-alpha) * 0.7); } -.footnote-side-item:not(:hover):not(:focus-within):not(.footnote-side-focused) .footnote-item > div:last-of-type { +.footnote-side-item:not(:hover):not(:focus-within):not(.footnote-side-focused) + .footnote-item + > div:last-of-type { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; diff --git a/components/Blocks/TextBlock/index.tsx b/components/Blocks/TextBlock/index.tsx index fd6a6be5..bce54fa1 100644 --- a/components/Blocks/TextBlock/index.tsx +++ b/components/Blocks/TextBlock/index.tsx @@ -170,7 +170,9 @@ export function RenderedTextBlock(props: {
{ let target = e.target as HTMLElement; @@ -290,13 +292,19 @@ export function BaseTextBlock(props: BlockProps & { className?: string }) { // forces break if a single text string (e.g. a url) spans more than a full line style={{ wordBreak: "break-word", - fontFamily: props.type === "heading" ? "var(--theme-heading-font)" : "var(--theme-font)", - ...(props.type === "heading" ? { fontSize: headingFontSize[headingLevel?.data.value || 1] } : {}), + fontFamily: + props.type === "heading" + ? "var(--theme-heading-font)" + : "var(--theme-font)", + ...(props.type === "heading" + ? { fontSize: headingFontSize[headingLevel?.data.value || 1] } + : {}), }} className={` ${alignmentClass} grow resize-none align-top whitespace-pre-wrap bg-transparent outline-hidden + ${focused ? "block-focused" : ""} ${props.type === "heading" ? HeadingStyle[headingLevel?.data.value || 1] : textStyle} ${props.className}`} @@ -316,7 +324,11 @@ export function BaseTextBlock(props: BlockProps & { className?: string }) { props.nextBlock === null ? ( // if this is the only block on the page and is empty or is a canvas, show placeholder
Date: Tue, 7 Apr 2026 00:40:48 -0400 Subject: [PATCH 2/3] fix build error --- actions/createNewLeaflet.ts | 1 - actions/emailAuth.ts | 2 +- actions/login.ts | 1 - actions/removeLeafletFromHome.ts | 2 +- actions/subscriptions/confirmEmailSubscription.ts | 2 +- actions/subscriptions/deleteSubscription.ts | 2 +- actions/subscriptions/sendPostToSubscribers.ts | 2 +- actions/subscriptions/subscribeToMailboxWithEmail.ts | 2 +- app/emails/unsubscribe/route.ts | 2 +- 9 files changed, 7 insertions(+), 9 deletions(-) diff --git a/actions/createNewLeaflet.ts b/actions/createNewLeaflet.ts index c94fa9f1..29e2f840 100644 --- a/actions/createNewLeaflet.ts +++ b/actions/createNewLeaflet.ts @@ -12,7 +12,6 @@ import { email_auth_tokens, } from "drizzle/schema"; import { redirect } from "next/navigation"; -import postgres from "postgres"; import { v7 } from "uuid"; import { sql, eq, and } from "drizzle-orm"; import { cookies } from "next/headers"; diff --git a/actions/emailAuth.ts b/actions/emailAuth.ts index 8fc2a21e..eb9d11a7 100644 --- a/actions/emailAuth.ts +++ b/actions/emailAuth.ts @@ -2,7 +2,7 @@ import { randomBytes } from "crypto"; import { drizzle } from "drizzle-orm/node-postgres"; -import postgres from "postgres"; + import { email_auth_tokens, identities } from "drizzle/schema"; import { and, eq } from "drizzle-orm"; import { cookies } from "next/headers"; diff --git a/actions/login.ts b/actions/login.ts index 120696b2..52c493c5 100644 --- a/actions/login.ts +++ b/actions/login.ts @@ -1,6 +1,5 @@ "use server"; import { drizzle } from "drizzle-orm/node-postgres"; -import postgres from "postgres"; import { email_auth_tokens, identities, diff --git a/actions/removeLeafletFromHome.ts b/actions/removeLeafletFromHome.ts index 0c1a9321..d794fbb7 100644 --- a/actions/removeLeafletFromHome.ts +++ b/actions/removeLeafletFromHome.ts @@ -2,7 +2,7 @@ import { drizzle } from "drizzle-orm/node-postgres"; import { permission_token_on_homepage } from "drizzle/schema"; -import postgres from "postgres"; + import { v7 } from "uuid"; import { sql, eq, inArray, and } from "drizzle-orm"; import { cookies } from "next/headers"; diff --git a/actions/subscriptions/confirmEmailSubscription.ts b/actions/subscriptions/confirmEmailSubscription.ts index f450b01b..cf3a86e2 100644 --- a/actions/subscriptions/confirmEmailSubscription.ts +++ b/actions/subscriptions/confirmEmailSubscription.ts @@ -8,7 +8,7 @@ import { facts, permission_tokens, } from "drizzle/schema"; -import postgres from "postgres"; + import type { Fact } from "src/replicache"; import { Database } from "supabase/database.types"; import { pool } from "supabase/pool"; diff --git a/actions/subscriptions/deleteSubscription.ts b/actions/subscriptions/deleteSubscription.ts index 5199e2ac..2cca23b6 100644 --- a/actions/subscriptions/deleteSubscription.ts +++ b/actions/subscriptions/deleteSubscription.ts @@ -2,7 +2,7 @@ import { drizzle } from "drizzle-orm/node-postgres"; import { email_subscriptions_to_entity, facts } from "drizzle/schema"; -import postgres from "postgres"; + import { eq, and, sql } from "drizzle-orm"; import type { Fact } from "src/replicache"; import { v7 } from "uuid"; diff --git a/actions/subscriptions/sendPostToSubscribers.ts b/actions/subscriptions/sendPostToSubscribers.ts index 8c5d4bed..1e4f9bfa 100644 --- a/actions/subscriptions/sendPostToSubscribers.ts +++ b/actions/subscriptions/sendPostToSubscribers.ts @@ -5,7 +5,7 @@ import { createServerClient } from "@supabase/ssr"; import { and, eq } from "drizzle-orm"; import { drizzle } from "drizzle-orm/node-postgres"; import { email_subscriptions_to_entity, entities } from "drizzle/schema"; -import postgres from "postgres"; + import type { PermissionToken } from "src/replicache"; import { Database } from "supabase/database.types"; import { pool } from "supabase/pool"; diff --git a/actions/subscriptions/subscribeToMailboxWithEmail.ts b/actions/subscriptions/subscribeToMailboxWithEmail.ts index 4117bc56..cbd3e892 100644 --- a/actions/subscriptions/subscribeToMailboxWithEmail.ts +++ b/actions/subscriptions/subscribeToMailboxWithEmail.ts @@ -5,7 +5,7 @@ import { createServerClient } from "@supabase/ssr"; import { and, eq } from "drizzle-orm"; import { drizzle } from "drizzle-orm/node-postgres"; import { email_subscriptions_to_entity } from "drizzle/schema"; -import postgres from "postgres"; + import { getBlocksWithTypeLocal } from "src/replicache/getBlocks"; import type { Fact, PermissionToken } from "src/replicache"; import type { Attribute } from "src/replicache/attributes"; diff --git a/app/emails/unsubscribe/route.ts b/app/emails/unsubscribe/route.ts index 8f3adace..3ff40722 100644 --- a/app/emails/unsubscribe/route.ts +++ b/app/emails/unsubscribe/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { drizzle } from "drizzle-orm/node-postgres"; import { email_subscriptions_to_entity } from "drizzle/schema"; -import postgres from "postgres"; + import { eq } from "drizzle-orm"; import { pool } from "supabase/pool"; -- 2.51.2 From 9980796e1a77eb0fcad4be7b11d60d4f14e78589 Mon Sep 17 00:00:00 2001 From: Brendan Schlagel Date: Tue, 7 Apr 2026 12:47:59 -0400 Subject: [PATCH 3/3] remove referrers for other blocks that contain links --- components/Blocks/BlueskyPostBlock/BlueskyRichText.tsx | 3 +++ components/Blocks/ButtonBlock.tsx | 1 + components/Blocks/EmbedBlock.tsx | 1 + components/Blocks/ExternalLinkBlock.tsx | 1 + 4 files changed, 6 insertions(+) diff --git a/components/Blocks/BlueskyPostBlock/BlueskyRichText.tsx b/components/Blocks/BlueskyPostBlock/BlueskyRichText.tsx index fb6e648e..993bdf31 100644 --- a/components/Blocks/BlueskyPostBlock/BlueskyRichText.tsx +++ b/components/Blocks/BlueskyPostBlock/BlueskyRichText.tsx @@ -28,6 +28,7 @@ export function BlueskyRichText({ href={segment.link.uri} className="text-accent-contrast hover:underline" target="_blank" + rel="noopener noreferrer" > {segment.text} , @@ -42,6 +43,7 @@ export function BlueskyRichText({ href={`https://bsky.app/profile/${segment.mention.did}`} className="text-accent-contrast hover:underline" target="_blank" + rel="noopener noreferrer" > {segment.text} , @@ -56,6 +58,7 @@ export function BlueskyRichText({ href={`https://bsky.app/tag/${segment.tag.tag}`} className="text-accent-contrast hover:underline" target="_blank" + rel="noopener noreferrer" > {segment.text} , diff --git a/components/Blocks/ButtonBlock.tsx b/components/Blocks/ButtonBlock.tsx index f7e0604d..c4207a2b 100644 --- a/components/Blocks/ButtonBlock.tsx +++ b/components/Blocks/ButtonBlock.tsx @@ -41,6 +41,7 @@ export const ButtonBlock = (props: BlockProps & { preview?: boolean }) => { { src={url?.data.value} allow="fullscreen" loading="lazy" + referrerPolicy="no-referrer" > {/*
diff --git a/components/Blocks/ExternalLinkBlock.tsx b/components/Blocks/ExternalLinkBlock.tsx index 52e32883..907615d9 100644 --- a/components/Blocks/ExternalLinkBlock.tsx +++ b/components/Blocks/ExternalLinkBlock.tsx @@ -73,6 +73,7 @@ export const ExternalLinkBlock = (
-- 2.51.2