Skip to content

[Profiler] Use tabular design for HTTP request/headers #355

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

Merged
merged 1 commit into from
Nov 20, 2019
Merged

[Profiler] Use tabular design for HTTP request/headers #355

merged 1 commit into from
Nov 20, 2019

Conversation

ostrolucky
Copy link
Collaborator

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Related tickets partially #245
Documentation
License MIT

What's in this PR and why?

Improved profiler design. Check Before and After. Also check linked issue.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

Out of scope

  • <t(d|h)> text trimming. I just want to make this simple first time. This can be added in future, at this time horizontal scrolling works perfect here.
  • Syntax highlighting for body. Should be done in separate PR, I want to minimze scope here which will help review and merge this faster.

@dbu
Copy link
Collaborator

dbu commented Nov 18, 2019

awesome, thanks! and completely agree to keep syntax highlighting or more complicated layouting tweak to separate pull requests to make it easier to review.

can you please rebase? there is a conflict (i guess because #354 adding a link to the debug token)

@ostrolucky
Copy link
Collaborator Author

I've slightly changed the design of #354, because its label style didn't fit in my feature, hopefully that's fine.

Screenshot 2019-11-18 at 10 32 54

@dbu
Copy link
Collaborator

dbu commented Nov 18, 2019

i like it! @dbrumann as you contributed the profile link, i ask you if you are happy with this too or want a change?

@dbrumann
Copy link

These changes look great. 👍 I like it. I will have a look at the code changes later today, but consider the end result approved

@ostrolucky
Copy link
Collaborator Author

ostrolucky commented Nov 18, 2019

It just accured to me that maybe we could just highlight any link in header table instead? Because if you notice, there is a x-debug-token-link header there already. That would be more universal

@dbu
Copy link
Collaborator

dbu commented Nov 18, 2019

as this is a very specific thing to symfony, i like the link at the top.

additionally detecting urls in headervalues and link them sounds like a good idea (for a separate pull request)

@ostrolucky
Copy link
Collaborator Author

Allright. We can also reduce complexity further by getting token link from header to display in twig, then Profiler no longer needs to store it separately.

@dbu dbu mentioned this pull request Nov 18, 2019
@dbu
Copy link
Collaborator

dbu commented Nov 18, 2019

indeed. i see you removed the token from the display and from the profiler data (i think thats good, the token code does not help and is annoying to copy-paste if its part of a link anyways, better copy-paste from the headers). want to do that in this PR or separately?

@ostrolucky
Copy link
Collaborator Author

I can do it here

@ostrolucky
Copy link
Collaborator Author

done

{% set hasReachedBody = false %}
{% set content = '' %}
{% set data = data|split("\n")|slice(1) %}
{% set xdebugTokenLink = data|filter(v => 'x-debug-token-link:' in v|lower)|first|split(':')|slice(1)|join(':')|trim %}
Copy link
Collaborator

@dbu dbu Nov 19, 2019

Choose a reason for hiding this comment

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

could you instead split with a limit of 1, to not break up the url and then have to re-join it? would be more elegant imho. i think: data|filter(v => 'x-debug-token-link:' in v|lower)|first|split(':', 2)|slice(1)|trim (but i have not actually tested it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I came up with even better simplification. WDYT?

@dbu
Copy link
Collaborator

dbu commented Nov 20, 2019

nice!

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