Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebProfilerBundle] [WIP] Add help in Web Profiler#21046

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
maidmaid wants to merge4 commits intosymfony:masterfrommaidmaid:help

Conversation

@maidmaid
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

Hello,

Symfony is a truly ideal framework to teach young future web developer to create a complete and robust web application, thanks to the excellent quality of its documentation.

Several links of this documentation are already present directly in the source code, making learning and understanding of Symfony easier. In the same idea, this PR proposes to add links of documentation in the Web Profiler, to allow a better pedagogical experiment.

The next first example adds cookie doc link:

screenshot from 2016-12-24 22-21-10

WDYT?

ogizanagi, yceruto, and dunglas reacted with thumbs up emoji
@maidmaidmaidmaid changed the title[Web Profiler] [WIP] Add help in Web Profiler[WebProfilerBundle] [WIP] Add help in Web ProfilerDec 24, 2016
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

I really really like this idea!

(and enjoy your christmas! 🎄)

->end()
->booleanNode('intercept_redirects')->defaultFalse()->end()
->scalarNode('excluded_ajax_paths')->defaultValue('^/(app(_[\\w]+)?\\.php/)?_wdt')->end()
->booleanNode('help')->defaultFalse()->end()
Copy link
Member

Choose a reason for hiding this comment

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

As Symfony already has lots of config options, it's often tried to avoid adding many more options. I think this is a case where a config option is not required. Always enabling help will only add some minor question mark icons, which aren't that distracting (and maybe even helpfull for everyone). Always enabling it will also make code a lot easier (avoiding many if statements).

returnarray(
new \Twig_SimpleFunction('profiler_dump',$profilerDump,array('is_safe' =>array('html'),'needs_environment' =>true)),
new \Twig_SimpleFunction('profiler_dump_log',array($this,'dumpLog'),array('is_safe' =>array('html'),'needs_environment' =>true)),
new \Twig_SimpleFunction('help',array($this,'help'),array('is_safe' =>array('html'))),
Copy link
Member

Choose a reason for hiding this comment

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

I would propose to call thishelp_attrs or the like, to cover the usage of the method more (calling it attrs makes it very clear that this has to be executed inside a tag).

.help {
display: inline-block;
text-align: center;
background-color: #6da581;
Copy link
Member

Choose a reason for hiding this comment

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

I propose to make the color a bit lighter (less contrasting with the background, e.g. a light grey). Help icons shouldn't get attention when looking the page, they should only be visible when one needs it.

I'm afraid using the highlight/primary color will make it too distracting.

@wouterj
Copy link
Member

status: needs work

@linaori
Copy link
Contributor

I'm all for this idea!

@ro0NL
Copy link
Contributor

👍 we should keep a single resource though containing all references (think maintenance).

And perhaps we should just provide a list of links (imo. there can be more relevent references then doc+api).

# help.ymlcookies:  -'/some/ref'  -'/other-ref'# etc.

Also 👍 for making it configurable :)

@maidmaid
Copy link
ContributorAuthor

maidmaid commentedDec 25, 2016
edited
Loading

I have addedhelp.yml containing all references as@ro0NL suggested, removedhelp config, refactoredhelp_attr twig function and improved design like this:

screenshot from 2016-12-26 00-58-13

@javiereguiluz
Copy link
Member

I think I like the idea ... but the implementation looks overkill to me. Why can't we just simply put the links in the HTML templates instead of using a YAML config file + Twig functions? (but please, don't make any change yet, this is just a comment)

dunglas reacted with thumbs up emoji

@fabpot
Copy link
Member

Regarding the implementation: I agree with@javiereguiluz

Regarding the feature: I'm not sure that people looking at cookies in the web profiler expect to get documentation or API docs from there. Let's see what other @symfony/deciders think about it.

@maidmaid
Copy link
ContributorAuthor

maidmaid commentedDec 26, 2016
edited
Loading

@javiereguiluz the Twig function manages the Symfony version of the project that is included in the documentation URL. These dynamic URL can not be defined directly in templates.

@fabpot Yes, the example of cookies is not the most relevant, but for example links of documentation in the Security section will be very useful.

@nicolas-grekasnicolas-grekas added this to the3.x milestoneDec 26, 2016
@ro0NL
Copy link
Contributor

Should we consider havingSfjs.set/getPreference to make this opt-in/out (rather easily)? And perhaps find a clean way to have some simple panel to actually control/expose preferences?

I proposed the YAML file.. and it could indeed be overkill (not sure how many links we expect to end up around templates?). Perhaps a static array in code is better?

@fabpot
Copy link
Member

As you know, we try very hard to not create new option/configuration when not strictly needed. This is a great example of something that should not be configured. If we think it's interesting, it should always be there (and it's not that disturbing anyway). But before going further, I would like to get a list of links we could add and where. I'm still not convinced that this is the best place to add links to the docs.

dunglas and sstok reacted with thumbs up emoji

@ro0NL
Copy link
Contributor

ro0NL commentedDec 26, 2016
edited
Loading

This is a great example of something that should not be configured.

Agree. I think the no. of question icons shown on the same page is crucial here.

With the latest design (sorry) i think after a few days the grey dots would start annoy me. So the design should be really slick here (smaller icons imo.).., but that's matter of preference (<punch line here>).

@dunglas
Copy link
Member

dunglas commentedDec 26, 2016
edited
Loading

I like the idea of making it easy for newcomers to know where to find the relevant documentation. IMO, having the link to the article is enough, the API doc will be displayed directly in the IDE if the user uses a good one.

@ogizanagi
Copy link
Contributor

@ro0NL : If you fear to be annoyed by these helping dots, I'd rather invite you to use something likeStylish and a custom css rule instead of making it configurable 😄
(However the dots seem way too big on the current screenshot IMHO 😅)

sstok reacted with laugh emoji

@ro0NL
Copy link
Contributor

ro0NL commentedDec 26, 2016
edited
Loading

@ogizanagi eventually yes. But if people start doing that, maybe the design is bad. Note im not saying there's a holy grail or so which works for everbody.

Im not so sure about API links, they dont seem relevant. And wouldnt it be nicer to have 1 single help icon per page? I.e on top?

@stof
Copy link
Member

I agree with@javiereguiluz and@fabpot about this system being overkill.

And I think that links to the doc are more useful than links to the API doc. I would not link to the API doc from the profiler.

wouterj and sstok reacted with thumbs up emoji

returnarray(
new \Twig_SimpleFunction('profiler_dump',$profilerDump,array('is_safe' =>array('html'),'needs_environment' =>true)),
new \Twig_SimpleFunction('profiler_dump_log',array($this,'dumpLog'),array('is_safe' =>array('html'),'needs_environment' =>true)),
new \Twig_SimpleFunction('help_attrs',array($this,'help'),array('is_safe' =>array('html'))),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be prefixed withprofiler_ to prevent conflicts with other extensions.

@maidmaid
Copy link
ContributorAuthor

About@fabpot quote:

But before going further, I would like to get a list of links we could add and where.

Here,my list of links proposal:

Main TitleSymfony Profiler (on top right)

PanelRequest / Response

PanelPerformance

  • TitlePerformance (missing title):Doc

PanelLogs

PanelForms

For each fields:

  • Title<name field>: doc of form type (example withTextType type form:Doc)
  • SectionDefault Data:Doc
  • SectionSubmitted Data:Doc
  • SectionPassed Options andResolved Options:
    • for each option, doc of option (example withlabel option forTextType form type:Doc)
    • for each constraint option, doc of constraint (example withNotBlank constraint:Doc)

PanelException

  • TitleExceptions:Doc

PanelEvents

  • TitleEvent Dispatcher:Doc,Component,Tools
  • Eventkernel.request:Doc
  • Eventkernel.controller:Doc
  • Eventkernel.view:Doc
  • Eventkernel.response:Doc
  • Eventkernel.finish_request:Doc
  • Eventkernel.terminate:Doc
  • Eventkernel.exception:Doc
  • Eventconsole.command:Doc
  • Eventconsole.exception:Doc
  • Eventconsole.terminate:Doc

PanelRouting

PanelTranslation

PanelSecurity

Section Security Token:

  • BoxAuthenticated:Doc
  • PropertyRoles:Doc
  • PropertyInherited Roles:Doc

Section Security Firewall:

  • SectionSecurity Firewall:Doc
  • Keyprovider:Doc
  • Keyentry_point:Doc
  • Keyuser_checker:Doc
  • Keyaccess_denied_handler:Doc
  • Keylisteners:Doc

Section Security Voters:

  • SectionSecurity Voters:Doc
  • BoxStrategy:Doc
  • Voter classSymfony\Component\Security\Core\Authorization\Voter\RoleVoter:Doc
  • Voter classSymfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter:Doc

PanelTwig

PanelDoctrine

PanelE-mails

PanelDebug

PanelConfiguration

  • BoxEnvironment:Doc
  • BoxApplication name:Doc
  • SectionEnabled Bundles:Doc

@tjaari
Copy link

Nice addition 👍

@fabpot
Copy link
Member

I still think this is not the right place for such links. But that's just my opinion of course. @symfony/deciders WDYT?

@fabpot
Copy link
Member

By the way,#21081 seems like a much better idea.

@fabpot
Copy link
Member

Closing as I haven't changed my mind. That's not the right place.

@fabpotfabpot closed thisFeb 16, 2017
@nicolas-grekasnicolas-grekas modified the milestone:3.xMar 24, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@wouterjwouterjwouterj left review comments

+1 more reviewer

@sstoksstoksstok left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

13 participants

@maidmaid@wouterj@linaori@ro0NL@javiereguiluz@fabpot@dunglas@ogizanagi@stof@tjaari@sstok@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp