Skip to content

Consider adding an infobox to data explorer for grouped results #2054

Closed

Description

@coffeemug

If the user doesn't call ungroup, simply showing the results may be confusing. One option is to add an infobox for these cases.

I'm adding this to 1.12-polish. Let me play with the GMR implementation when @mlucy finishes his latest round of changes. I'll comment on this issue then to say if it's worth doing.

This shouldn't take more than a day to do, so @neumino should have plenty of time to finish it for 1.12 if we decide to get this in.

TL;DR: do nothing for now, I'll comment on this shortly.

Activity

  1. added this to the milestone on Mar 4, 2014
  2. self-assigned this
    on Mar 4, 2014
  3. assigned and unassigned on Mar 6, 2014
  4. neumino commented on Mar 7, 2014

    @neumino
    Member

    I put a blue info box for the warning (it looks better than an alert) in case the user gets back a GROUPED_DATA.

    The question now is what do we put in the warning.

    From what I understood (correct me if I'm wrong), the point of the warning is to let people know that the type returned is not a DATUM even though we display it as a DATUM.
    The main consequence being that any method chained after the query will be applied to each reduction, unless ungroup is called.

    Should we phrase it as
    "The returned result is a GROUPED_DATA. Any method chained after the current query will be applied on each reduction."

    Ping @coffeemug, @mlucy -- any though on what the message should be?

  5. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    I wouldn't refer to GROUPED_DATA since people don't necessarily know what it is.

    Here is one possibility:

    Any command chained after group will be applied to each reduction. Add a call to ungroup to convert the result to an array.

    It would also be great to have a cookbook entry for this and add a link to it in the message.

  6. neumino commented on Mar 7, 2014

    @neumino
    Member

    If we don't mention GROUPED_DATA, it doesn't make sense to say that ungroup is going to convert the result to an array (since users already get back an array)

    Would that be better?

    Any command chained after group will be applied to each reduction. Add a call to ungroup if you want to execute a method on all the groups.

  7. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    Yes, that's much better!

  8. neumino commented on Mar 7, 2014

    @neumino
    Member

    @mlucy any thought?

  9. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    Two more thoughts:

    • We should strive to make the presentation of the message strike the fleeting balance between being noticeable and unobtrusive. If we screw up the former, people will run into this problem and will get frustrated. If we screw up the latter, people will quickly get annoyed that we're telling them something they already know.
    • I think a link to the cookbook/troubleshooting entry on this in the message is pretty important. The message is great, but there is no way to fully remove all confusion unless you already know what's going on.
  10. neumino commented on Mar 7, 2014

    @neumino
    Member

    Up in review 1298
    Branch michel_2054_infobox

    The warning appears when you get back a GROUPED_DATA (but not on the profile view).
    If you close the warning, you will never see it again (as long as you use the same browser).

    The text currently spawn over 2 lines, which I don't really like.

  11. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    Will check it out soon.

  12. 1 remaining item

  13. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    We can make the message tighter and have it not spill to multiple lines. Here is shorter, tighter text:

    Commands chained after group will apply to each reduction. Call ungroup to execute commands on all the groups.

    Also, a few more notes:

    • The original message interchanged the words "method" and "command". When we refer to ReQL commands we should always call them "commands" (in the docs, UI, etc.)
    • The little x to close the infobox seems too far left. It should be closer to the border.
    • The style of x when you mouse over it is odd. In the yellow box (say, when you delete a table and get a message that a table has been deleted), mousing over x results in it being bolder (which I like). Mousing over the x in the blue infobox here results in it being underlined. Also, the font styles for each x appear different. We should use a consistent style for both types of infoboxes.

    Other than these comments, everything is awesome.

    Also a question -- will this show up in the autocomplete docs after tabs/dots? (I don't think it's worth taking the time to do it, btw; I think this implementation is great)

  14. modified the milestones: 1.12, on Mar 7, 2014
  15. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    Some more feedback.

    @mlucy proposed the following message, which I like more (it seems both more precise and easier to understand):

    Commands chained after group will operate on each reduction. Call ungroup to operate on the array of groups.

    Also, after some thought, I don't like the fact that clicking the x will hide the message forever. It's far to easy to a) click it without reading the message, and b) read the message, click on the x, and then run a group query later completely forgetting about the message.

    I'm not sure what the solution is. We could remove the x entirely (which I'd be ok with), or add a setting "remind me about groupings" or something. I think for now we should just force people to put up with this message and see what users think about it.

    @neumino -- thoughts?

  16. mlucy commented on Mar 7, 2014

    @mlucy
    Member

    I think always leaving the message there is slightly better.

  17. neumino commented on Mar 7, 2014

    @neumino
    Member

    I'm personally don't really like the warning. It's intrusive in the sense that nothing bad can happen -- it's not like if the user can declare a machine dead.
    For me it would be like if we were adding a warning every time the user was using reduce that would tell the user that this is not a fold.

    So users have to be able to hide it.

    I'll fix the style for now, but if we decide not to display it, I would be happy to delete my branch :-)

  18. mlucy commented on Mar 7, 2014

    @mlucy
    Member

    Having a way to hide it and being able to hide it permanently by clicking a small x are different.

  19. neumino commented on Mar 7, 2014

    @neumino
    Member

    We have the same behavior for the update warning for now.

    I could add an option in the data explorer, but that seems like over doing things.
    Ping @mglukhovsky -- thoughts?

  20. coffeemug commented on Mar 7, 2014

    @coffeemug
    ContributorAuthor

    The update warning is different because if you hide it by clicking x, it will show up again on the next update. Clicking x doesn't turn it off permanently.

    I see what you mean, though, with your fold analogy. May be a better alternative is to put it in gray text under the edit box? Or give it an entirely different style so it seems less obtrusive?

    Let's talk to @mglukhovsky on Monday, I bet we'll come up with something that makes everyone reasonably happy.

  21. mglukhovsky commented on Mar 8, 2014

    @mglukhovsky
    Member

    There should be a way to collapse the infobox, not dismiss it. We also may
    want to use the less obtrusive infobox style we've introduced into the web
    UI.

    I'd like to sit down with @neumino on Monday to come up with a clever
    solution.

    On Fri, Mar 7, 2014 at 3:23 PM, Slava Akhmechet [email protected]:

    The update warning is different because if you hide it by clicking x, it
    will show up again on the next update. Clicking x doesn't turn it off
    permanently.

    I see what you mean, though, with your fold analogy. May be a better
    alternative is to put it in gray text under the edit box? Or give it an
    entirely different style so it seems less obtrusive?

    Let's talk to @mglukhovsky https://github.com/mglukhovsky on Monday, I
    bet we'll come up with something that makes everyone reasonably happy.

    Reply to this email directly or view it on GitHubhttps://github.com//issues/2054#issuecomment-37078972
    .

  22. neumino commented on Mar 10, 2014

    @neumino
    Member

    Warning inside the description of a function if you are after a group (at the same level) is available in branch michel_2054_embedded_warning.

    You need to update the docs to see it working.

    michel@newton:~/rethinkdb/next/rethinkdb$ git diff docs/rql/reql_docs.json
    diff --git a/docs/rql/reql_docs.json b/docs/rql/reql_docs.json
    index 4428cf1..38f22a4 100644
    --- a/docs/rql/reql_docs.json
    +++ b/docs/rql/reql_docs.json
    @@ -731,6 +731,48 @@
         "example": "<p><strong>Example:</strong> Using a predefined reduction we can easily find the average strength of members of each weight class.</p>\n<p><co
         "name": "groupBy"
       }, 
    +  "api/javascript/group/": {
    +    "body": "sequence.group(...) ...", 
    +    "description": "<p>Blablabla</p>", 
    +    "url": "filter", 
    +    "io": [
    +      [
    +        "sequence", 
    +        "sequence"
    +      ], 
    +      [
    +        "stream", 
    +        "stream"
    +      ], 
    +      [
    +        "array", 
    +        "array"
    +      ]
    +    ], 
    +    "example": "<p><strong>Example:</strong> Blabla</p>", 
    +    "name": "group"
    +  }, 
    +  "api/javascript/ungroup/": {
    +    "body": "sequence.ungroup(...) ...", 
    +    "description": "<p>Blablabla</p>", 
    +    "url": "filter", 
    +    "io": [
    +      [
    +        "sequence", 
    +        "sequence"
    +      ], 
    +      [
    +        "stream", 
    +        "stream"
    +      ], 
    +      [
    +        "array", 
    +        "array"
    +      ]
    +    ], 
    +    "example": "<p><strong>Example:</strong> Blabla</p>", 
    +    "name": "ungroup"
    +  }, 
       "api/javascript/filter/": {
         "body": "sequence.filter(predicate[, {default: false}]) &rarr; selectionstream.filter(predicate[, {default: false}]) &rarr; streamarray.filter(predicate[,
         "description": "<p>Get all the documents for which the given predicate is true.</p>\n<p><code>filter</code> can be called on a sequence, selection, or a f
    @@ -1794,4 +1836,4 @@
         "example": "<p><strong>Example:</strong> Return the users born on the 24th of any month.</p>\n<p><code>r.table(\"users\").filter(\n    r.row(\"birthdate\"
         "name": "day"
       }
    -}
    \ No newline at end of file
    +}
    
  23. neumino commented on Mar 11, 2014

    @neumino
    Member

    After talking with @mglukhovsky we switch from a warning after the execution of the query to a warning inside the description of a function.
    The warning is inside a gray box so it easily catch the attention of the user.

    Up in review 1303 assigned to @mglukhovsky
    Branch michel_2054_embedded_warning

  24. neumino commented on Mar 11, 2014

    @neumino
    Member

    Also, the warning appear only if you are on the same "level", that is to say:

    r.table("foo").group("bar").map( // warning is displayed
    r.table("foo").group("bar").map( function(doc) { doc.merge // warning not displayed
    
  25. neumino commented on Mar 14, 2014

    @neumino
    Member

    Merged in next as 11f9125
    Ship 1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions