nextcloud / nextcloud/calendar

Retain sorting order for hidden calendars when hiding+unhiding

Open
#6,632 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement
Dominant language
JavaScript
Stars
1.2k
Forks
332
Avg merge
16h 13m
Merged PRs (30d)
137

Description

Is your feature request related to a problem? Please describe.
  • #6536

introduced the issue that hidden calendar will not retain their order in the visible calendars list.
More concretely, if you hide and un-hide a calendar, it will be appended to the visible calendars list at the bottom no matter the previous ordering.

I, and I assume others too, often hide and un-hide calendars based on what I calendars I need rn (I have lots of calendars), resulting in an unordered mess which one would have to reorder upon every hide/un-hide.

Describe the solution you'd like

I propose the following "align-at-top" solution:

  • When I drag a calendar B to a new position, what I usually intend to do is to place said calendar B below another calendar A (in the visible list).
    (At least that's how my brain works, after all the list expands from top to bottom).
  • This would be implemented by fetching calendar A above calendar B after the reordering and then just insert the calendar ID of B right after A in the ordering
  • If I move a calendar to the top of the visible list, this ofc should result in an ordering that starts with that calendar (no matter if previously another hidden calendar took the first spot).

In the example from the PR: When I move calendar 4 up in the visible list to 1, 4, 3
This would turn into a unique ordering [1, 4, 2, 3] because 1 is the calendar in the visible list above 4 after reordering.

Describe alternatives you've considered

It is not perfect but the most intuitive approach, that solves this issue, I could come up with.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #6536 and its linked example to understand how calendar ordering currently changes when calendars are hidden and shown again. Reproduce the hide/unhide and drag scenarios described here; done means the visible order is retained and the example produces the unique ordering [1, 4, 2, 3].

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.