On Fri, Sep 22, 2017 at 11:24 PM, Craig Russell <[email protected]> wrote: > > The agenda roll call has two issues: > > 1. While taking roll call, there is traffic between client and server much > more than is needed. The client receives multiple refreshes of the roll for > each participant. It is difficult to tell why the screen is refreshing. It's > strange that the entire roll refreshes several times. I'd like to review the > code and perhaps simplify it so that each participant tick box generates a > single message to the server and a single message back. Maybe I'm dreaming.
Here's the relevant code: https://github.com/apache/whimsy/blob/master/www/board/agenda/views/pages/roll-call.js.rb Notes: 1) self.pending is set to true whenever a checkbox is clicked or focus leaves an input field (i.e. the place where you note arrival and exit times) and the text in that input field has changed. 2) Whenever the screen is updated (line 206), self.pending is checked, and if true, a single messages is sent to the server which gets a single response, and self.pending is reset. Note that JavaScript is single threaded so this logic can't be interrupted; and that the response (the do..end part of the post call) is processed asynchronously. > 2. Once participants are added, there is no way to remove them. They continue > to appear like zombies. Fixing this will require some design work. We might > need to keep track of: > > participants who are in the agenda and not yet marked as present > participants who are in the agenda and are marked as present > non-participants who are in the agenda and were incorrectly marked as present > participants who are not in the agenda and are marked as present > non-participants who are not in the agenda and were incorrectly marked as > present I believe that much if not all of that is already tracked. Here it may help to start with the server view of the state: https://whimsy.apache.org/board/agenda/2017-09-20.yaml In the roll-call.js.rb code linked above, search for "add remaining attendees". > In the attached screen shot, I made a few attempts to get David Fisher onto > the agenda with sad results. One thing the current code supports is guests that are not committers. To add a non-committer, type their name and click the checkbox. The problem here is that once added, they can not be removed from display. Note: this only affects the display: people who are not listed in the agenda and do not attend do not appear in the draft minutes. A client side solution to this might be to NOT add an attended to the list of people if they are not present (note: people listed in the agenda are added to separately). This could be as simple as changing line 89 to people << person if person.present The server will still track such names, but they won't appear on the roll call web page or in the draft minutes. If it is desired to remove name from what the server is tracking, that code would go someplace in here: https://github.com/apache/whimsy/blob/master/www/board/agenda/views/actions/minute.json.rb#L32 Perhaps something like: attendance.delete_if do |name, records| not records[:present] and not people.find {|id, person| person[:name] == name} end Perhaps around line 89? > Craig > > Craig L Russell > Secretary, Apache Software Foundation > [email protected] http://db.apache.org/jdo - Sam Ruby
