fix(desktop): preserve thread edit guards in focus preview

Co-authored-by: tho <80c5f18be5aafa62cf6198c6335963ba3306b595288117c8ea2f805fc9bdc94a@buzz.block.builderlab.xyz>
Signed-off-by: tho <80c5f18be5aafa62cf6198c6335963ba3306b595288117c8ea2f805fc9bdc94a@buzz.block.builderlab.xyz>
This commit is contained in:
Rizz
2026-08-25 15:31:45 -07:00
parent 410b1ab5f4
commit f60760c7f0
2 changed files with 5 additions and 0 deletions

View File

@@ -522,6 +522,7 @@ export const ChannelPane = React.memo(function ChannelPane({
useFocusThreadDrawer ? (
<FocusThreadDrawer
channelName={activeChannel?.name ?? "channel"}
hasActiveEdit={threadEditTarget !== null}
key={THREAD_SURFACE_KEY}
onClose={onCloseThread}
>

View File

@@ -39,6 +39,7 @@ type UseChannelAgentSessionsOptions = {
openAgentSessionPubkey: string | null;
openThreadHeadId: string | null;
profilePanelPubkey?: string | null;
requireThreadEditResolution?: () => boolean;
setChannelManagementOpen: (open: boolean) => void;
setExpandedThreadReplyIds: (value: Set<string>) => void;
setOpenAgentSessionChannelId: PanelValueSetter;
@@ -173,6 +174,7 @@ export function useChannelAgentSessions({
openAgentSessionPubkey,
openThreadHeadId,
profilePanelPubkey = null,
requireThreadEditResolution = () => true,
setChannelManagementOpen,
setExpandedThreadReplyIds,
setOpenAgentSessionChannelId,
@@ -209,6 +211,7 @@ export function useChannelAgentSessions({
const openAgentSession = React.useCallback(
(pubkey: string, channelId?: string | null) => {
if (!requireThreadEditResolution()) return;
if (!isAgentSessionOpen) {
returnTarget.capture(
resolveAgentSessionReturnTarget({
@@ -234,6 +237,7 @@ export function useChannelAgentSessions({
isAgentSessionOpen,
openThreadHeadId,
profilePanelPubkey,
requireThreadEditResolution,
returnTarget,
setChannelManagementOpen,
setExpandedThreadReplyIds,