Skip to content

Allow searching by Content-Type in the network marker view#5351

Merged
canova merged 5 commits into
firefox-devtools:mainfrom
padenot:search-content-type
Feb 11, 2025
Merged

Allow searching by Content-Type in the network marker view#5351
canova merged 5 commits into
firefox-devtools:mainfrom
padenot:search-content-type

Conversation

@padenot

@padenot padenot commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

@julienw julienw requested a review from canova February 5, 2025 15:56
canova
canova previously requested changes Feb 5, 2025

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the patch, there were some zero width spaces for some reason in the changes and that made all the CI fail. Also I applied the formatting changes.

Unfortunately tests are still failing. Apparently this change made it appear the content type twice in the tooltip. Here are some pics:
Before:
Screenshot 2025-02-05 at 9 53 58 PM

After:
Screenshot 2025-02-05 at 9 54 12 PM

Notice the new "Content type" at the top in addition to "MIME type".
So unfortunately this PR needs some more changes to hide it in the tooltip and make sure that only one of them is visible.

This is the place we append the network maker details to the tooltip:

case 'Network': {
// Network markers embed lots of timing information inside of them, that
// must be reworked in the tooltip.
details.push(...getNetworkMarkerDetails(data));
break;

And this is the place we add the data fields that are inside the schema:
// Don't add undefined values, as values are optional.
if (value !== undefined && value !== null) {
details.push(
<TooltipDetail
key={schema.name + '-' + key}
label={label || key}
>
{formatMarkupFromMarkerSchema(
schema.name,
format,
value,
thread.stringTable,
threadIdToNameMap,
processIdToNameMap
)}
</TooltipDetail>
);
}

So we would need to either clear the details for the network markers in here, or we need to have a field in the schema to indicate that a field is hidden. Markus recently filed a bug about this already: #5299

@padenot So probably this is more work than you initially intended. Would you want to work on it or would you want to let us handle the rest?

@canova

canova commented Feb 6, 2025

Copy link
Copy Markdown
Member

We can add hidden: true field after #5354 lands to make this work and land.

@canova

canova commented Feb 10, 2025

Copy link
Copy Markdown
Member

Hey @julienw, I've changed the code slightly after landed #5354. It would be good if you can review it.

@canova canova requested a review from julienw February 10, 2025 16:50
@canova canova dismissed their stale review February 10, 2025 16:51

redirecting

@codecov

codecov Bot commented Feb 10, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.84%. Comparing base (3f80e20) to head (baea128).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5351   +/-   ##
=======================================
  Coverage   85.84%   85.84%           
=======================================
  Files         312      312           
  Lines       29829    29829           
  Branches     8214     8214           
=======================================
  Hits        25607    25607           
  Misses       3627     3627           
  Partials      595      595           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me!
do you think you could add a quick test to src/test/components/NetworkChart.test.js?

@canova

canova commented Feb 11, 2025

Copy link
Copy Markdown
Member

Thanks for the review!

looks good to me! do you think you could add a quick test to src/test/components/NetworkChart.test.js?

Hm, I don't necessarily think that this needs extra testing. This field is essentially the combination of two things: searchable and hidden fields. And we have individual tests for both of them already.

@canova canova merged commit a06fb6f into firefox-devtools:main Feb 11, 2025
@canova canova mentioned this pull request Feb 19, 2025
canova added a commit that referenced this pull request Feb 19, 2025
## Updates:

[Nicolas Chevobbe] Make timeline ruler notches visible in High Contrast
Mode (#5346)
[Nazım Can Altınova] Add the ability to mark marker fields as hidden
(#5354)
[Maxx Crawford] Update guide-startup-shutdown.md (#5357)
[Nazım Can Altınova] Enable prettier on the docs-user markdown files
(#5358)
[Paul Adenot] Allow searching by Content-Type in the network marker view
(#5351)
[Florian Quèze] Hide the pid in global tracks if it is 0. (#5361)
[Markus Stange] Make inverting the call tree fast, by computing inverted
call nodes lazily (#4900)
[Markus Stange] Use 64-bit floats for call tree timings. (#5371)
[Markus Stange] Extend the workaround in the v53 upgrader to generate
missing subcategory columns. (#5369)

## Also thanks to our localizers:

de: Michael Köhler
el: Jim Spentzos
en-GB: Paul
es-CL: ravmn
fr: Théo Chevalier
fur: Fabio Tomat
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo
nl: Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
sv-SE: Luna Jernberg, Andreas Pettersson
tr: Grk
uk: Іhor Hordiichuk
zh-CN: Olvcpr423
zh-TW: Pin-guang Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants