Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Task view improvements #11413

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Hamsterarsch
Copy link

Contributes to #11378

Sneak peak

image

Change Overview

  • changes task view in the side bar
  • adds three tabs that can be used to filter displayed tasks (closed,open,hidden)
  • adds the ability to hide tasks (moves them to hide tab)
  • adds a button to hide/reveal all currently displayed tasks in bulk (intended for users with many present tasks)
  • removes grouping of tasks by source discussion (link to discussion is now available using the arrow button instead of using discussion title). I did not feel like the discussion title added much to the recognizability of a task entry and keeping them would have made frontend code much more complex.
  • changes a bunch of locales (only en so far) to match changed functionality
  • Backend: Adds a new table tasks_users_extension that represents a many many relationship. It stores per user and per task data such as the now required 'hidden' value for a task. (The existing tasks_users relation was unsuitable for this type of storage because it's entries represent what users have been mentioned by a task. Adding more data to it would have required a more extensive change of the task parsing code). Although right now, the tasks_users_extension table only holds the 'hidden' column, I saw old comments in code about a potential mute/silence feature for individual tasks - this would be the place to add such future persistent state.
  • Pre-existing ruby tests are passing (see below)
  • layout shrinks properly on mobile (at least on my machine)

Problem Areas

  1. The JS end to end test for the new task page is incomplete. I couldn't figure out which test suite is used by only going off of the existing tests so I couldn't really work on it. Also, I wasn't sure if they are used at all because they are so few of them.
  2. I am unsure about the convention around dependent: destroy; I added dependent destroy between task and the new table tasks_users_extension but then I saw that there is no such dependency between task and user. I was wondering if this is intentional. If it isn't, I would add the dependency between both user/task and user/tasks_users_extension. Therefore, the last test in task_service_spec which tests user deletion = extension deletion currently fails.
  3. The frontend code to hide/reveal all is not using a dedicated update all function on the backend. I don't think this functionality will be used often or with so many tasks that it becomes a performance issue so it didn't seem valuable enough to justify adding more code.

I'm sure there will be more problems - looking forward to them!

@robguthrie
Copy link
Member

Wow. This is incredble. Love how you've understood the Loomio architecture and are making great progress. Also really like the tab UI.

@Hamsterarsch
Copy link
Author

(I just noticed the changes to sidebar/userdropdown are still in here - just ignore those.)

Hamsterarsch added 2 commits March 6, 2025 12:15
… destruction

In case author users are destroyed, their tasks (which might still be assigned to other users) don't need to be destroyed
@Hamsterarsch
Copy link
Author

  • todo: Add filter or view for assigned/created by you

@Hamsterarsch Hamsterarsch marked this pull request as draft March 6, 2025 12:03
@Hamsterarsch
Copy link
Author

Updates

  • Added a dropdown to filter by assigned to user, created by user, all (assigned to user is default)
  • Changed layout to vcard to support expiry counter (things didn't fit in a single line anymore). A nice side effect is that the tasks usually display in full now, although 1/3rd of the viewport is the limit
  • Removed e2e tests because (1) don't know how to run them (2) not sure how to select elements in the DOM without copying overly verbose selectors from debugger (3) it's not that critical if the task view breaks

Remarks

  • When filtering tasks for assigned/authored I noticed that the doer_id column in Tasks does not seem to actually represent who is supposed to do a task? I had to remove it from the query in the task controller to get the required result.

Present ruby tests are passing

Screens

@robguthrie if this looks good to you, this should be in a mergeable state now as far as I am concerned

@Hamsterarsch Hamsterarsch marked this pull request as ready for review March 7, 2025 21:45
@robguthrie
Copy link
Member

thanks, very exciting.

I've just tested positive for covid, so I'll need a few days before my brain is back online. Sorry for the delay.

@Hamsterarsch
Copy link
Author

thanks, very exciting.

I've just tested positive for covid, so I'll need a few days before my brain is back online. Sorry for the delay.

Get well soon; it's not urgent after all (and I suppose the next release is still a while off anyways)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants