[checklist] Improve checklist extension and user interface

Review Request #6969 - Created Feb. 22, 2015 and submitted

Wang Jun Sun
rb-extension-pack
7099
8989a11...
rb-extension-pack, students

This change aims to polish up the existing checklist UI as well as its code base.

On the UI:

  • Shifted the UI to be fixed at the bottom (better than in the middle of nowhere)
  • Uses existing Reviewboard icons as buttons (versus textual buttons)
  • Reworked toggling of the interface (using CSS animation)
  • Editing an item selects/highlights the entire text (like renaming files)
  • Ability to cancel edit via Esc key or button
  • Word wrapping of long item descriptions
  • Now escapes special characters in the item descriptions
  • Trims the string before adding or editing, avoids empty descriptions

In the front end:

  • Removed delete checklist functionality (since new checklist is generated upon refresh)
  • Moved remove item method from collection view to item view
  • So that item ids do not have to be stored in DOM
  • Fixed a bug where editing multiple items only picks the value of the first item being edited
  • Enforce hyphens for ids and classes, and single quotes for strings

Glass box front end testing on Chrome 40.0.2214. Quick tests for UI on Safari 8.0.2.

  • Toggling size works
  • Marking an item as done or undone works
  • Deleting an item works
  • Editing an item works
  • Cancelling item editing works
  • Adding an item works
  • Long text is wrapped
  • Special characters are escaped
  • Can edit multiple items without conflict
  • Whitespace in description is trimmed
Loading file attachments...

  • 0
  • 0
  • 11
  • 2
  • 13
Description From Last Updated
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
    
    
  2. 
      
Wang Jun Sun
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
David Trowbridge
  1. Can we maybe split the backend and frontend changes into two separate review requests?

  2. Instead of adding a new class for this, we should just put everything under the #checklist rule.

    1. Placing it under the #checklist rule causes all child elements to be CSS reset due to #checklist * having more priority than the other classes. .checklist * is less specific and hence has less priority.

  3. Wrap this to 80 columns.

  4. Maybe define constants somewhere for Enter & Esc?

  5. Can this be wrapped to 80 columns?

  6. Else should go on the same line as the closing } from the previous block.

  7. Only one blank line here.

  8. This is only used once. Maybe skip the variable definition and just call .remove(this.model)?

  9. It looks like removeItemDB is only called from here? How would you feel about inlining the code?

    1. I think the methods involving the server and database can be better written, perhaps inlining should be done in another review request, since this particular chunk is mainly about moving the removeItem methods from the ChecklistView to the ChecklistItemView.

    2. Sure.

  10. 
      
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/extension.py
        checklist/checklist/resources.py
    
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
Wang Jun Sun
Review Bot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
Wu Di
  1. 
      
  2. If it's just #FFFFFF there isn't a need to use a variable here since css already has white

    1. Thanks for pointing this out, using black and white instead of #000 and @white now.

  3. If this value is tied to the max-width of .checklist-item-desc on line 103, you might want to make it a variable.

    1. Added LESS variables as much as possible, thanks.

  4. I believe that you can simply do if (itemDesc) here since you've already trimmed it

    1. Do you mean if (!itemDesc)? I feel that the current condition is more explicit though.

  5. 
      
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
Wang Jun Sun
Review Bot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
David Trowbridge
  1. 
      
  2. "size" is not a valid attribute on a <div>.

  3. Can we use <span> instead of <i>?

  4. This doesn't seem right. It should be:

    if (event.keyCode === $.ui.keyCode.ENTER ||
        event.keyCode === 13) {
    
    1. This only fails if $.ui.keyCode.ENTER is defined as something else other than 13, although I agree that your suggestion makes things clearer and failproof.

  5. 
      
Wang Jun Sun
Review Bot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
        checklist/checklist/static/js/models/checklistAPI.js
        checklist/checklist/static/css/style.less
        checklist/checklist/templates/checklist/template.html
    
    
  2. 
      
David Trowbridge
  1. Ship It!
  2. 
      
Wang Jun Sun
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (743ada6)
Loading...