Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev-overlay] Dim ignore-listed callstack frames when shown #76862

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -39,17 +38,10 @@ export const CallStackFrame: React.FC<{
return (
<div
data-nextjs-call-stack-frame
data-nextjs-call-stack-frame-ignored={!hasSource}
style={
{
'--index': index,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raunofreiberg confirmed that this is unused.

} as React.CSSProperties
}
data-nextjs-call-stack-frame-no-source={!hasSource}
data-nextjs-call-stack-frame-ignored={frame.ignored}
>
<div
data-nextjs-frame-expanded={!frame.ignored}
className="call-stack-frame-method-name"
>
<div className="call-stack-frame-method-name">
<HotlinkedText text={formattedMethod} />
{hasSource && (
<button onClick={open} className="open-in-editor-button">
Expand Down Expand Up @@ -77,17 +69,21 @@ export const CallStackFrame: React.FC<{
}

export const CALL_STACK_FRAME_STYLES = `
[data-nextjs-call-stack-frame-ignored] {
[data-nextjs-call-stack-frame-no-source] {
padding: 6px 8px;
margin-bottom: 4px;

border-radius: var(--rounded-lg);
}

[data-nextjs-call-stack-frame-ignored]:last-child {
[data-nextjs-call-stack-frame-no-source]:last-child {
margin-bottom: 0;
}

[data-nextjs-call-stack-frame-ignored="true"] {
opacity: 0.6;
}

[data-nextjs-call-stack-frame] {
user-select: text;
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function CallStack({ frames, dialogResizerRef }: CallStackProps) {
</div>
{frames.map((frame, frameIndex) => {
return !frame.ignored || isIgnoreListOpen ? (
<CallStackFrame key={frameIndex} frame={frame} index={frameIndex} />
<CallStackFrame key={frameIndex} frame={frame} />
) : null
})}
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/lib/next-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading