Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Initial Quick Docs implementation #3449

Merged
merged 7 commits into from
Apr 18, 2013
Merged

Conversation

peterflynn
Copy link
Member

This introduces:

  • In core: a "Quick Docs" command and an extension point for it, paralleling Quick Edit
  • In an extension: a specific Quick Docs provider for the Web Platform Docs CSS dataset

This doesn't include final XD layout/styles yet, so initial feedback should focus on the JS parts.

@ghost ghost assigned jasonsanjose Apr 16, 2013
* origin/master: (28 commits)
  updated package validator based on comments in #3437
  remove spurious IntelliJ files
  Updated by ALF automation.
  Another round of code review changes.
  Move HTML templates to htmlContent
  Tweaked dialog so it's centered a little better
  Renamed ExtensionMgr to ExtensionManager
  Code review fixes.
  Update comments to remove the Mustache note, since these can work with Handlebars too
  Make JSHint happy.
  Respond to review comments
  Initial extension manager dialog/view/model (with non-final layout)
  Move out hover preview menu item label to strings.js for localization. Remove unused variables and clean up some variable declarations.
  Merging Glenn's Hover Preview extension into core.
  Only allow leading numbers and letters (largely to prevent names like "..")
  import rewire to assist in testing
  Update Getting started screenshot for 'de' locale
  Fix DISALLOWED_WORDS placeholder in 'de' locale
  Updated by ALF automation.
  'de' locale: Fix Travis build errors (duplicate strings), minor wording edits
  ...
@jasonsanjose
Copy link
Member

Reviewing

@@ -130,6 +130,8 @@ define(function (require, exports, module) {
menu.addMenuItem(Commands.TOGGLE_QUICK_EDIT);
menu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH);
menu.addMenuItem(Commands.QUICK_EDIT_NEXT_MATCH);
menu.addMenuDivider();
Copy link
Member

Choose a reason for hiding this comment

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

Normally we ask extensions to add menus within the extension and not in DefaultMenus right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but this isn't an extension Command, is a new Quick Docs Command handled by the Editor Manager and the extension just adds a new Quick Docs provider that uses this command, just like Quick Edit works.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes. Thanks for catching my mistake. :)

@jasonsanjose
Copy link
Member

Initial review complete

@peterflynn
Copy link
Member Author

@jasonsanjose the final UI parts have landed if you'd like to get started reviewing the HTML/LESS while I finish making those changes from your JS feedback.

* Update inline widget height when horizontal resizing causes word wrap to
shift around
* Show full URL on link tooltips
* Remove unneeded timeout in onAdded() which was copied from
InlineImageViewer (where it seems to just be a hack for image load timing)
* Remove unneeded check for spaces in URLs
* Fix missing 'return null'
@peterflynn
Copy link
Member Author

@jasonsanjose fixes pushed. The two issues within the JSON file (uppercase properties and forward slash escaping) are still waiting on Adam, so would you mind spinning them off as a code cleanup bug to unblock the pull request?

@jasonsanjose
Copy link
Member

Sure, see #3471. Reviewing changes.

return result.promise();

} else {
return null;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I was thinking more of a base case return null outside of this if/else block, at the end of this function.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought this way would help emphasize that the if above doesn't have any fall-through cases...

@jasonsanjose
Copy link
Member

Nested scrolling in an inline widget is just as bad as I remembered it. I think it's ok to take for now, but I think it warrants more discussion.


// Set height initially, and again whenever width might have changed (word wrap)
this._sizeEditorToContent();
$(window).on("resize", this._sizeEditorToContent);
Copy link
Member

Choose a reason for hiding this comment

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

We should resize when the sidebar shows/hides too. We can file that separately if you like.

Copy link
Member

Choose a reason for hiding this comment

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

Added this cleanup to #3471

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, good catch. I'll assign the bug to myself.

<h1>{{propName}}</h1>
<div>{{{summary}}}</div>
</div>
<div class="divider-holder">
Copy link
Member

Choose a reason for hiding this comment

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

Usually I'm not picky about non-semantic markup, but this jumped out at me. I assume this is tricky for some reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah... see the comment on the LESS rule for it. Essentially, to get the line centered in the gap between columns we need its offset to be some percentage plus half the fixed-size gap. I suppose we could use calc() for that but I've always been a little unsure how well non-IE browsers support that stuff...

Fwiw the .content-bottom div is another thing we only need for layout, since it's impossible to put a margin/padding gap directly between floated content and an immediate sibling (e.g. see http://stackoverflow.com/questions/4198269/in-css-margin-top-is-not-working-with-clear-both).

@jasonsanjose
Copy link
Member

@peterflynn done with round 2. I think the only thing blocking an immediate merge is the quiet-scrollbars issue. We can file everything else as cleanup. I would have made the change myself and merged, but in just in case, I want to give you the chance to make the call.

@peterflynn
Copy link
Member Author

Re the nested scrolling UX: yeah... I think we should do something to improve it a bit before sprint's end. What do you think of the three changes I proposed on email yesterday? (bottom shadow; make scrollbar visible while using arrow keys; don't let scrollwheel/trackpad "overrun" and start scrolling editor).

For me the biggest pain point is the scrollwheel issue... but once the keyboard nav work is in maybe that will become more annoying for many people... hard to say.

@peterflynn
Copy link
Member Author

Pushed up another round of fixes

@jasonsanjose
Copy link
Member

re: nested scrolling

  • Yes to a below-the-fold indicator
  • Show scrollbars on keyboard nav...mice to have, but lower priority to me than the shadow and the janky nested scroll.
  • Yes to prevent bubbling. Agreed that this is the biggest annoyance.

@jasonsanjose
Copy link
Member

Merging

jasonsanjose added a commit that referenced this pull request Apr 18, 2013
Initial Quick Docs implementation
@jasonsanjose jasonsanjose merged commit d8d5a15 into master Apr 18, 2013
@jasonsanjose jasonsanjose deleted the pflynn/quick-docs-api branch April 18, 2013 17:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants