fix(ui): place run link in same row as feedback buttons, right-aligned
When a comment has both helpful/needswork feedback buttons and a run link, the run link now appears right-aligned in the same row instead of a separate section below. Comments with only a run link (no feedback buttons) still show the run link in its own bordered row. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
a13a67de54
commit
993a3262f6
2 changed files with 19 additions and 2 deletions
|
|
@ -336,10 +336,24 @@ function CommentCard({
|
||||||
sharingPreference={feedbackDataSharingPreference}
|
sharingPreference={feedbackDataSharingPreference}
|
||||||
termsUrl={feedbackTermsUrl}
|
termsUrl={feedbackTermsUrl}
|
||||||
onVote={onVote}
|
onVote={onVote}
|
||||||
|
rightSlot={comment.runId && !isPending ? (
|
||||||
|
comment.runAgentId ? (
|
||||||
|
<Link
|
||||||
|
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
|
||||||
|
className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
|
||||||
|
>
|
||||||
|
run {comment.runId.slice(0, 8)}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground">
|
||||||
|
run {comment.runId.slice(0, 8)}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
) : undefined}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{comment.runId && !isPending ? (
|
{comment.runId && !isPending && !(comment.authorAgentId && onVote && !isQueued) ? (
|
||||||
<div className="mt-2 pt-2 border-t border-border/60">
|
<div className="mt-3 pt-3 border-t border-border/60">
|
||||||
{comment.runAgentId ? (
|
{comment.runAgentId ? (
|
||||||
<Link
|
<Link
|
||||||
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
|
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,14 @@ export function OutputFeedbackButtons({
|
||||||
sharingPreference = "prompt",
|
sharingPreference = "prompt",
|
||||||
termsUrl = null,
|
termsUrl = null,
|
||||||
onVote,
|
onVote,
|
||||||
|
rightSlot,
|
||||||
}: {
|
}: {
|
||||||
activeVote?: FeedbackVoteValue | null;
|
activeVote?: FeedbackVoteValue | null;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
sharingPreference?: FeedbackDataSharingPreference;
|
sharingPreference?: FeedbackDataSharingPreference;
|
||||||
termsUrl?: string | null;
|
termsUrl?: string | null;
|
||||||
onVote: (vote: FeedbackVoteValue, options?: { allowSharing?: boolean; reason?: string }) => Promise<void>;
|
onVote: (vote: FeedbackVoteValue, options?: { allowSharing?: boolean; reason?: string }) => Promise<void>;
|
||||||
|
rightSlot?: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const [pendingVote, setPendingVote] = useState<{
|
const [pendingVote, setPendingVote] = useState<{
|
||||||
vote: FeedbackVoteValue;
|
vote: FeedbackVoteValue;
|
||||||
|
|
@ -130,6 +132,7 @@ export function OutputFeedbackButtons({
|
||||||
<ThumbsDown className="mr-1.5 h-3.5 w-3.5" />
|
<ThumbsDown className="mr-1.5 h-3.5 w-3.5" />
|
||||||
Needs work
|
Needs work
|
||||||
</Button>
|
</Button>
|
||||||
|
{rightSlot ? <div className="ml-auto">{rightSlot}</div> : null}
|
||||||
</div>
|
</div>
|
||||||
{collectingDownvoteReason ? (
|
{collectingDownvoteReason ? (
|
||||||
<div className="mt-2 rounded-md border border-border/60 bg-accent/20 p-3">
|
<div className="mt-2 rounded-md border border-border/60 bg-accent/20 p-3">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue