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

[Initial review] Create new rule from CSS quick edit#5532

Merged
dangoor merged 35 commits intomasterfrom
css-quick-edit-new-selector
Oct 17, 2013
Merged

[Initial review] Create new rule from CSS quick edit#5532
dangoor merged 35 commits intomasterfrom
css-quick-edit-new-selector

Conversation

@njx
Copy link
Copy Markdown

@njx njx commented Oct 16, 2013

To @dangoor - let me know if you want a quick walkthrough of the changes by phone. Also note that the functionality to update the rule list if the user edits a selector hasn't been added yet, but everything else should work.

redmunds and others added 26 commits October 10, 2013 12:59
…les. Mostly working, but header doesn't show in that case.
* Factor out wrapper, header, editor holder, and filename divs so they're permanent instead of recreating them on every switch
* Change `editors` field to just `editor` since we only ever have one editor
* Make appearance of message area a little closer to final design
@ghost ghost assigned dangoor Oct 16, 2013
Comment thread src/editor/CSSInlineEditor.js Outdated
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.

nit: the other functions here have jsdoc comments. I'm not actually very particular about jsdoc comments for simple interior functions like this, but it would be more consistent to have a comment since the others do.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@redmunds - do you want to add comments for those functions? If not I can take a stab at it.

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.

I'll add jsdoc comments

@njx
Copy link
Copy Markdown
Author

njx commented Oct 16, 2013

It looks like a bad CM submodule SHA snuck in again. @larz0, remember to do a git submodule update any time you merge from master or pull an update to the branch before you make new commits.

@redmunds
Copy link
Copy Markdown
Contributor

I'm done with my changes. @njx Let me know if there's anything I missed.

Comment thread src/editor/InlineTextEditor.js Outdated
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.

I'll grant that this API likely won't have a lot of consumers, but it seems like any consumer of this API would want this performance improvement, unless there are likely different approaches that would be used to hide and show the editor or different desired timings...

I don't know how others would use the createInlineEditorForDocument API, but it does seem likely that someone would call it without hiding the container first.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's a good point, though I do think there really aren't any other likely callers of that API. But given that, it seems reasonable to move the hide/show into it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed.

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

I'll finish the review in the morning (Eastern time).

@njx
Copy link
Copy Markdown
Author

njx commented Oct 17, 2013

I think I've addressed all the comments so far.

Comment thread src/editor/MultiRangeInlineEditor.js Outdated
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.

nit: for consistency with the changes below, it might be nice to change this to $("<li/>")

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

Review complete. Looks good, and I really like the new feature! Only some minor stuff here.

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

One thing I didn't notice while reviewing is a keyboard shortcut for adding a new rule, which is mentioned in the criteria. Did I just miss it somewhere?

@redmunds
Copy link
Copy Markdown
Contributor

No. Any suggestions on which keyboard shortcut to use?

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

cmd-shift-N?

We could also override existing shortcuts since this is a contextual shortcut.

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

Also, we'd probably want the shortcut to be displayed on a tooltip for the button, given that it won't be on a menu.

@njx
Copy link
Copy Markdown
Author

njx commented Oct 17, 2013

Hmmm. This is a little fuzzy to me, because we put the "explicit keyboard shortcut to create new rule" (from the main editor) in the Out of Scope list. I don't exactly recall talking about having a specific (separate) shortcut that would work from within the inline editor...though I think we did talk about whether there was a way to make the button take focus from the keyboard (so you could hit Return to activate it).

I'll bring it up in standup today.

@njx
Copy link
Copy Markdown
Author

njx commented Oct 17, 2013

Fixed the remaining code cleanup issues. I'm tracking the keyboard shortcut as a separate task, so we should be able to merge this now unless you see anything else.

@njx
Copy link
Copy Markdown
Author

njx commented Oct 17, 2013

BTW, one other little tweak I want to make is to make it so that if there's only one stylesheet in your project, clicking New Rule immediately creates the rule in that stylesheet instead of popping up the dropdown. I'll add that in a future pull request.

@dangoor
Copy link
Copy Markdown
Contributor

dangoor commented Oct 17, 2013

Looks good. Merging.

dangoor added a commit that referenced this pull request Oct 17, 2013
[Initial review] Create new rule from CSS quick edit
@dangoor dangoor merged commit 4ef64fd into master Oct 17, 2013
@dangoor dangoor deleted the css-quick-edit-new-selector branch October 17, 2013 17:55
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.

4 participants