From f33a4b321613685f509c5aea34f1a39dd0c458f6 Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Sat, 8 Mar 2025 12:18:57 +0100 Subject: [PATCH] [dev-overlay] Dim ignore-listed callstack frames when shown (#76862) --- .../call-stack-frame/call-stack-frame.tsx | 24 ++++++++----------- .../errors/call-stack/call-stack.tsx | 2 +- test/lib/next-test-utils.ts | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/packages/next/src/client/components/react-dev-overlay/ui/components/call-stack-frame/call-stack-frame.tsx b/packages/next/src/client/components/react-dev-overlay/ui/components/call-stack-frame/call-stack-frame.tsx index 0cec358a48dde..ef8b89783772e 100644 --- a/packages/next/src/client/components/react-dev-overlay/ui/components/call-stack-frame/call-stack-frame.tsx +++ b/packages/next/src/client/components/react-dev-overlay/ui/components/call-stack-frame/call-stack-frame.tsx @@ -8,8 +8,7 @@ import { useOpenInEditor } from '../../utils/use-open-in-editor' export const CallStackFrame: React.FC<{ frame: OriginalStackFrame - index: number -}> = function CallStackFrame({ frame, index }) { +}> = function CallStackFrame({ frame }) { // TODO: ability to expand resolved frames const f: StackFrame = frame.originalStackFrame ?? frame.sourceStackFrame @@ -39,17 +38,10 @@ export const CallStackFrame: React.FC<{ return (
-
+
{hasSource && (
{frames.map((frame, frameIndex) => { return !frame.ignored || isIgnoreListOpen ? ( - + ) : null })}
diff --git a/test/lib/next-test-utils.ts b/test/lib/next-test-utils.ts index ab00e0a9eb876..84b0a914d8873 100644 --- a/test/lib/next-test-utils.ts +++ b/test/lib/next-test-utils.ts @@ -1676,7 +1676,7 @@ export async function getStackFramesContent(browser) { const stackFramesContent = ( await Promise.all( stackFrameElements.map(async (frame) => { - const functionNameEl = await frame.$('[data-nextjs-frame-expanded]') + const functionNameEl = await frame.$('.call-stack-frame-method-name') const sourceEl = await frame.$('[data-has-source="true"]') const functionName = functionNameEl ? await functionNameEl.innerText()