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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
URL:
  <http://savannah.nongnu.org/task/?12775>

                 Summary: Display a "day changed" notification when two
messages in buffer are on different days
                 Project: WeeChat
            Submitted by: yamatt
            Submitted on: Wed 21 Aug 2013 08:23:24 AM GMT
                Category: display
         Should Start On: Wed 21 Aug 2013 12:00:00 AM GMT
   Should be Finished on: Wed 21 Aug 2013 12:00:00 AM GMT
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
                IRC nick: yamatt

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
Follow-up Comment #1, task #12775 (project weechat):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
Follow-up Comment #2, task #12775 (project weechat):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
Follow-up Comment #3, task #12775 (project weechat):

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)
}

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
Update of task #12775 (project weechat):

                  Status:                    None => Done                  
        Percent Complete:                      0% => 100%                  
             Assigned to:                    None => flashcode              
         Planned Release:                    None => 0.4.2                  

    _______________________________________________________

Follow-up 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).

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev
Reply | Threaded
Open this post in threaded view
|

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

Eric L.-2
Update of task #12775 (project weechat):

             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?12775>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/


_______________________________________________
Weechat-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/weechat-dev