taskWeeChat - Tasks: task #12775, Display a "day changed"...

 
 

task #12775: Display a "day changed" notification when two messages in buffer are on different days

Submitter:  Matt Copperwaite <yamatt>
Submitted:  Wed 21 Aug 2013 08:23:24 AM UTC
 
Category:  display Should Start On:  Wed 21 Aug 2013 12:00:00 AM UTC
Should be Finished on:  Wed 21 Aug 2013 12:00:00 AM UTC Priority:  * 5 - Normal
Status:  Done Privacy:  Public
Percent Complete:  100% Assigned to:  flashcode
Originator Name:  Open/Closed:  Closed
Planned Release:  0.4.2 IRC nick:  yamatt
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Sun 25 Aug 2013 07:53:32 AM UTC, comment #4: 

Done.

So the day change is now dynamic and displayed:
- before the first line of buffer (if day of first line is different from current date)
- between two lines when day changes
- after last line (if day of last line is different from current date).

Sebastien Helleu <flashcode>
Project Administrator
Wed 21 Aug 2013 12:01:20 PM UTC, comment #3: 

Suggested display pseudo-code for display which should be ok with corner cases (any number of lines), if you want some inspiration, this is how I think it should work to display lines. Totally ignoring how display works at the moment, feel free to completely ignore:

display() {
  time = now()
  index = buffer.num_lines - 1
  while(!window.full() && index >= 0) {
    line = buffer.lines[index]
    if (time - line.time() >= 1day) {
      window.push_back(day_change(line.time(), time))
      time = line.time()
      continue;
    }
    window.push_back(line)
    --index;
  }
  display window # window.line[0] is bottom of the screen
}

day_change(now, before) {
  from_string = ""
  if (now - before >= 2days) {
    from_string = "from %t" % before.date
  }
  return "Day changed %s to %t" % (from_string, now.date)
}

Peter Boström <pbos>
Project Member
Wed 21 Aug 2013 09:55:49 AM UTC, comment #2: 

I +1 for all the ideas here.

If the message is displayed only when the buffer is displayed (and then not stored as a line in the buffer), then the filters are not a problem. WeeChat should just check if the date between two messages displayed (ie non filtered) is different and displays "Day changed to XXX" with the date of the second message.

And by the way with such feature, the code in logger plugin to display similar message in backlog can be removed too, since it will be automatic.

Sebastien Helleu <flashcode>
Project Administrator
Wed 21 Aug 2013 09:43:00 AM UTC, comment #1: 

I'd like this as well. To expand: I have some very inactive buffers, such as highmon, and channels when using smart-filter that have several day-changed messages in a row. It would be very nice to have these contracted to "Day changed from Fri, 16 Aug 2013 to Mon, 19 Aug 2013" between messages, when they're more than one day in between.

I'd still like a "day changed" at the bottom of the screen though, if the day has changed , to display that the last message might also be far away in time, even if there's no following message.

With these changes in place, per-window, multiple day-changed messages in the merged-servers window shouldn't have to be necessary, only that there's one "Day changed" that doesn't belong to any server, but rather the window displaying them.

They would have to update when enabling/disabling filters though, so I'm not sure how this ties in with existing code.

Peter Boström <pbos>
Project Member
Wed 21 Aug 2013 08:23:24 AM UTC, original submission:  

Following on from bug: https://savannah.nongnu.org/bugs/index.php?39826

To expand on the idea; it would be advisable to display a "day changed" notification between two messages displayed in a window when the date has changed. This is to signify that the messages may not be close to each other.

Matt Copperwaite <yamatt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by flashcode (Posted a comment)
  • -email is unavailable- added by pbos (Posted a comment)
  • -email is unavailable- added by yamatt (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-06 flashcode Open/ClosedOpen Closed
    2013-08-25 flashcode StatusNone Done
        Percent Complete0% 100%
        Assigned toNone flashcode
        Planned ReleaseNone 0.4.2

    Back to the top


    Powered by Savane 3.9