Skip to content

Commit 293b246

Browse files
committed
Nebula: Update Reasoning UI: show only latest presence in pending state (#6913)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR enhances the `Reasoning` component in the `Reasoning.tsx` file by improving the handling of text display based on the `isPending` prop, adding conditional rendering for showing all texts or just the last one. ### Detailed summary - Added `showAll` variable to determine if all texts should be displayed. - Introduced `lastText` to hold the last item from `props.texts`. - Updated the rendering logic to conditionally show all texts or just the last one based on `showAll`. - Changed `<span>` to `<span className="text-foreground">` for styling consistency. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent a317772 commit 293b246

File tree

1 file changed

+24
-12
lines changed
  • apps/dashboard/src/app/nebula-app/(app)/components/Reasoning

1 file changed

+24
-12
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/Reasoning/Reasoning.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export function Reasoning(props: {
1111
}) {
1212
const [_isOpen, setIsOpen] = useState(false);
1313
const isOpen = props.isPending ? true : _isOpen;
14+
const showAll = !props.isPending;
15+
const lastText = props.texts[props.texts.length - 1];
1416

1517
return (
1618
<DynamicHeight>
@@ -23,7 +25,7 @@ export function Reasoning(props: {
2325
{props.isPending ? (
2426
<TextShimmer text="Reasoning..." />
2527
) : (
26-
<span>Reasoning</span>
28+
<span className="text-foreground">Reasoning</span>
2729
)}
2830

2931
{!props.isPending && (
@@ -36,17 +38,27 @@ export function Reasoning(props: {
3638
)}
3739
</Button>
3840

39-
{isOpen && props.texts.length > 0 && (
40-
<ul className="list-none space-y-1.5">
41-
{props.texts.map((text) => (
42-
<li
43-
key={text}
44-
className="fade-in-0 animate-in text-muted-foreground text-sm leading-relaxed duration-300"
45-
>
46-
{text.trim()}
47-
</li>
48-
))}
49-
</ul>
41+
{isOpen && (
42+
<>
43+
{showAll && props.texts.length > 0 && (
44+
<ul className="list-none space-y-1.5">
45+
{props.texts.map((text) => (
46+
<li
47+
key={text}
48+
className="fade-in-0 animate-in text-muted-foreground text-sm leading-relaxed duration-300"
49+
>
50+
{text.trim()}
51+
</li>
52+
))}
53+
</ul>
54+
)}
55+
56+
{!showAll && lastText && (
57+
<div className="text-muted-foreground text-sm leading-relaxed">
58+
{lastText.trim()}
59+
</div>
60+
)}
61+
</>
5062
)}
5163
</DynamicHeight>
5264
);

0 commit comments

Comments
 (0)