mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
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:
@@ -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}
|
||||
>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user