From 5c974d6f4bf69250d1e0c771c59d22d9ec022edc Mon Sep 17 00:00:00 2001 From: willkhinz Date: Wed, 25 Mar 2026 04:18:06 -0700 Subject: [PATCH] fix: resolve [bug] [alpha] call stack empty state says `no stack frames` when no threads are available Signed-off-by: willkhinz --- FIX_PROPOSAL.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 FIX_PROPOSAL.md diff --git a/FIX_PROPOSAL.md b/FIX_PROPOSAL.md new file mode 100644 index 0000000..06b2977 --- /dev/null +++ b/FIX_PROPOSAL.md @@ -0,0 +1,34 @@ +To fix the issue, you need to add a separate fallback for the zero-thread case in the `CallStackPanel` component. + +You can achieve this by adding a conditional statement to check if there are any threads available before rendering the thread rows. If no threads are available, you can display a message indicating that no threads are available. + +Here's the exact code fix: + +```typescript +// /src/components/debugger/CallStackPanel.tsx + +// ... + +const hasThreads = threads().length > 0; +const hasMultipleThreads = hasThreads && threads().length > 1; + +// ... + +{ + hasThreads ? ( + // existing thread rows rendering code + ) : ( +
No threads available
+ ) +} + +// ... + +{ + frames().length === 0 && hasThreads ? ( +
No stack frames
+ ) : null +} +``` + +This code checks if there are any threads available and displays a "No threads available" message if not. If there are threads available, it checks if there are any frames and displays a "No stack frames" message if not. This way, the panel will correctly distinguish between the zero-thread state and the zero-frame state. \ No newline at end of file