fix(issues): move local-directory hint out of the comment composer (#3363)

The "Agent will work in-place at …" banner used to render directly above
the comment input, which made it read like an input adornment. Move it
to the top of the Activity section (below the "Activity" heading, above
the live agent card) so it reads as section context instead of composer
chrome. Update the component's JSDoc and tweak the margin (mb-2 → mt-3)
to match the new placement.

MUL-2752
This commit is contained in:
Bohan Jiang
2026-05-27 17:21:46 +08:00
committed by GitHub
parent 171ee842d4
commit bed032f937
2 changed files with 8 additions and 7 deletions

View File

@@ -1951,6 +1951,8 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</div>
</div>
<LocalDirectoryHint projectId={issue?.project_id} />
{/* Agent live output — sticky banner in the activity section,
keyed by issue id so switching issues remounts the card and
clears any in-flight task state from the previous issue.
@@ -2024,7 +2026,6 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
{/* Bottom comment input — no avatar, full width */}
<div className="mt-4">
<LocalDirectoryHint projectId={issue?.project_id} />
{/* key={id}: web's /issues/[id] route doesn't remount on
issueId change, so without an explicit key the editor
keeps the previous issue's in-memory content and the

View File

@@ -9,14 +9,14 @@ import { useLocalDaemonStatus } from "../../platform";
import { useT } from "../../i18n";
/**
* Banner shown above the chat / comment composer when the issue's project
* is pinned to a `local_directory` resource on **this** daemon. Tells the
* user "starting an agent here will use {label} ({path}) in-place" so they
* notice they are not getting an isolated git worktree.
* Banner shown at the top of the issue's Activity section when the
* project is pinned to a `local_directory` resource on **this** daemon.
* Tells the user "starting an agent here will use {label} ({path}) in-
* place" so they notice they are not getting an isolated git worktree.
*
* Rendered only on desktop: web has no daemon to compare against, so the
* "this machine" check would always fail. Web users will see local_directory
* resources read-only in the sidebar but no chat-input hint.
* resources read-only in the sidebar but no Activity-section hint.
*
* SSR-safe: the underlying hook reads `window.daemonAPI` defensively, so
* server renders return null.
@@ -48,7 +48,7 @@ export function LocalDirectoryHint({
if (matches.length === 0) return null;
return (
<div className="mb-2 space-y-1 rounded-md border border-dashed bg-muted/40 px-3 py-2 text-xs text-muted-foreground">
<div className="mt-3 space-y-1 rounded-md border border-dashed bg-muted/40 px-3 py-2 text-xs text-muted-foreground">
{matches.map((resource) => {
const ref = resource.resource_ref;
const label = (ref.label || resource.label || ref.local_path).trim() ||