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

feat: archive and restore wishes #183

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

Conversation

cj13579
Copy link
Contributor

@cj13579 cj13579 commented Jan 23, 2025

This change adds support for archiving (and restoring) wishes into a "hidden" list. This can be super useful for tidying up a wish list for items that you have received, or items that aren't a priority for you right now, but might be something that you want to be able to reference in the future so don't want to completely remove.

When in table mode (the default) and viewing your own wish list a new "Archive" option is available:

image

When clicked, a "Successfully archived item" messages flashes up and the item is removed from the wishlist. In a new, collapsed section titled "Archived items" all of the items archived are now visible:

image

Clicking the restore icon will remove the item from the archived list and make it visible again on the main wishlist. Clicking delete, will prompt you to make sure, and then delete the item like before (this prompt is also added to the delete action from the main wishlist):

image

The same functionality exists when using card mode:

  • Archiving from the wish list:
    image
  • Delete and restore from Archive list
    image

Also updated is the Wishlists page counts and details. The totals() function is expanded to report active and archived items. The counts on the progress bar, and the details list below only show progress towards "active" items (those not archived):

image

An option AUTO_ARCHIVE_PEDGES is also added. This might help with #170 but don't expect it to be widely used. When an item is pledged for someone, it will be automatically archived.

In my opinion, releasing this closes #164.

Copy link
Owner

@Wingysam Wingysam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some UX concerns with this. I think as a user I would want separate archives for each year rather than piling them all together. I'm also concerned with how this will interact with multiple wishlists in the future, like I might want a feature to make a private "Sam's Wishlist (2025)" and move all of the items from "Sam's Wishlist" to it.

I'm also concerned about the table of buttons being overwhelming. Maybe we could hide some of them inside a meatball/kebab menu? I'm thinking the edit, delete, move top, move bottom, and archive buttons could all be hidden behind a button.

package.json Outdated Show resolved Hide resolved
@cj13579
Copy link
Contributor Author

cj13579 commented Jan 24, 2025

I have some UX concerns with this. I think as a user I would want separate archives for each year rather than piling them all together. I'm also concerned with how this will interact with multiple wishlists in the future, like I might want a feature to make a private "Sam's Wishlist (2025)" and move all of the items from "Sam's Wishlist" to it.

@Wingysam, I don't think anything done here makes the migration to multiple lists any harder. In fact, I can see the Wishlist page actually being the same even when multiple wish lists are supported. A user object just has n lists and a list would have n items (of which those items are either active or archived. The routing to open a list can just be updated to load a specific list from the Wishlists page, but still load the page that we have today (and that's extended here).

I'm also concerned about the table of buttons being overwhelming. Maybe we could hide some of them inside a meatball/kebab menu? I'm thinking the edit, delete, move top, move bottom, and archive buttons could all be hidden behind a button.

I think that's also fair. I think that could be resolved as part of #154.

Copy link
Owner

@Wingysam Wingysam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far!

I'd like to have the stashing of buttons in a menu merged before this to avoid making the table look too complicated in the mean time.

br
details
summary= lang('WISHLIST_ARCHIVED_ITEMS')
if global._CC.config.wishlist.table
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be turned into a mixin with a couple of ifs for archive vs unarchive rather than duplicated. Something like +wishlist(groupType, groupItems)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a very good idea. I've had a go at implementing this in b088c7b

src/views/wishlist.pug Outdated Show resolved Hide resolved
src/views/wishlists.pug Outdated Show resolved Hide resolved
@cj13579
Copy link
Contributor Author

cj13579 commented Jan 25, 2025

@Wingysam what about something like this?

image

Top row is what it looks like when you've clicked on the hamburger, second row is what it looks like "normally". Hovering over each icon gives to the localized text of what the icon represents (though I think they do a good job at representing what they mean). The only thing that I have noticed with my change is that the up/down actions now error. Top and bottom work, but the individual moves don't.

You're pretty handy with that stuff, would you mind taking a look?

Also, mobile view:

  • Collapsed:
    image
  • Expanded:
    image

@Wingysam
Copy link
Owner

I think that's moving in the right direction! My vision for it is something similar to the Discord menu like this:
image

I think Bulma has some built-in components for that. I should be able to try it at some point.

@cj13579
Copy link
Contributor Author

cj13579 commented Jan 29, 2025

@Wingysam better?

image

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.

Feature Request: Archive / hide wishes
2 participants