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

Tweak Quick Edit error strings & update docs#7349

Merged
JeffryBooher merged 3 commits intomasterfrom
pflynn/quickedit-error-strings
Apr 3, 2014
Merged

Tweak Quick Edit error strings & update docs#7349
JeffryBooher merged 3 commits intomasterfrom
pflynn/quickedit-error-strings

Conversation

@peterflynn
Copy link
Copy Markdown
Member

  • Tweak Quick Edit error/feedback strings for clarity
  • Fix comments to reflect Quick Edit error related API changes
  • Fix outdated FileSyncManager docs (unrelated to the two above, but someone on IRC was just expressing confusion about this today so I figured I'd update this too)

@redmunds, would you be able to review?
CC @njx in case of feedback about the string changes

- Fix comments to reflect Quick Edit error related API changes
- Fix outdated FileSyncManager docs
Comment thread src/nls/root/strings.js
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed "provider" since it's an implementation term that probably won't mean much to end users

@redmunds
Copy link
Copy Markdown
Contributor

Thanks for reviewing these strings. The changes all look like improvements, except maybe the 1 case I noted. I won't be around to merge this change.

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.

I don't mind comments like this in the source but, for documentation, I don't think the API should feel like it has a pulse. Comments like "We can't determine the context" are fine in logic branches but in JSDoc it feels a little too folksy...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are already well over 1000 occurrences of "we" in our code today, so I think the horse maybe has already left the barn on that one :-) And this sentence was already structured that way...

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.

Yes, that was my veiled attempt to get you to re-word since you added a second "we" to the sentence making it feel a little sarcastic and folksy but it's also somewhat ambiguous with the 2 references to "we" : "we're not even close to to a context where we could..."

Maybe "The insertion point is not close enough to a context where we could provide..." is a little less ambiguous. If you wanted to keep it folksy you could say "You're not even close enough to a context where we could..." but that might be too folksy :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@JeffryBooher Change pushed that rewords this a little bit. Lmk if you need anything more to merge.

…e for

cursor pos being ambiguous between two class names.

Fix some more JSDoc typos found in code review.
@peterflynn
Copy link
Copy Markdown
Member Author

@njx / @TomMalbran changes pushed. Since @redmunds isn't around for re-review, can one of you vouch for this & merge?

(btw, the diff in the last commit will look cleaner with ?w=1 in the URL)

@njx
Copy link
Copy Markdown

njx commented Apr 2, 2014

Actually @JeffryBooher is the assigned reviewer - since he looked at it before, seems like he should finalize it.

@JeffryBooher
Copy link
Copy Markdown
Contributor

Feels like https://trello.com/c/YEd0m9Il should be higher on the backlog now. I really want to invoke the color picker before typing anything now...

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.

This is elegant code but wouldn't be easier and more performant to just check to see if the characters before & after tagInfo.position.offset are spaces and return between class names?

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.

actually disregard that. I guess this is fine. the fact that you added a call to .trim() and checked the result to make sure it wasn't an empty attribute made me think that this was all new code. Was there a reason to add the call to trim()? Was it just to avoid the logic in the event that it was class=" " which would probably need its error string that we should add...

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.

n/m that case is covered. what's confusing here is that the name is ERROR_CSSQUICKEDIT_CLASSNOTFOUND but the error displayed is "incomplete class attribute" which I guess is consistent with ID check below.

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.

Stealth comment: there may be whitespace other than the space char, so instead of using lastIndexOf(" ") I think a regex with \s should be used.

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.

Also, using trim() here is inefficient because it creates a new string and then manipulates it to remove the whitespace at start/end, where all you really want to do is to detect if string contains any non-whitespace characters. It's faster to use regex to check for existence of any \S.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@redmunds That was existing code, so I'm a little bit hesitant to touch it here. Maybe makes sense to fix as part of #7389?

@JeffryBooher
Copy link
Copy Markdown
Contributor

done with final review. just the 2 things to consider and this should be good to go.

correction: just the 1 thing I guess. It's not a big deal. LMK if you think it's too much. In general some of the constants are a little misleading such as "CLASS_NOT_FOUND" when we display "incomplete class attribute". Seems that the 2 should agree.

@JeffryBooher
Copy link
Copy Markdown
Contributor

I tested this and compared it to sprint 27 and it's much more friendly. I tested a few other scenarios as well and it feels pretty solid and it's a low-impact change. I'm ready to merge this if you don't want to fix that one comment I mentioned let me know and I will merge it.

@JeffryBooher
Copy link
Copy Markdown
Contributor

@peterflynn

@peterflynn
Copy link
Copy Markdown
Member Author

@JeffryBooher I think it's probably ok as is -- it's the same constant name used in the original PR that was already merged, and it didn't closely match what the user-visible string said back then either.

Re the other comments above, just to note: most of that code hasn't changed in this diff, it's just been indented. If you add ?w=1 to the end of the URL when viewing the diff it should highlight the actual code changes more clearly.

@JeffryBooher
Copy link
Copy Markdown
Contributor

wow @peterflynn where do you find this stuff :) that works wonderfully! Thanks for the tips on github.

@JeffryBooher
Copy link
Copy Markdown
Contributor

@peterflynn do you want to change the comment mentioned above?

@JeffryBooher
Copy link
Copy Markdown
Contributor

looks good. Merging.

JeffryBooher added a commit that referenced this pull request Apr 3, 2014
Tweak Quick Edit error strings & update docs
@JeffryBooher JeffryBooher merged commit b3cffc0 into master Apr 3, 2014
@JeffryBooher JeffryBooher deleted the pflynn/quickedit-error-strings branch April 3, 2014 21:47
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.

5 participants