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(ui, api): archive boards #6546

Merged
merged 21 commits into from
Jun 28, 2024
Merged

feat(ui, api): archive boards #6546

merged 21 commits into from
Jun 28, 2024

Conversation

maryhipp
Copy link
Collaborator

@maryhipp maryhipp commented Jun 26, 2024

Summary

Add the ability to archive boards, which essentially just hides them from view in the UI unless explicitly set to show them in settings. You also cannot use an archived board for auto-add functionality to avoid weirdness if its set and then archived boards are hidden.

This does add a new column to the database.

Related Issues / Discussions

Closes #3942

QA Instructions

Right-click on a board to archive it.
Toggle "Show archived boards" in gallery settings
Right-click on an archived board to unarchive it.

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

@github-actions github-actions bot added api python PRs that change python files services PRs that change app services frontend PRs that change frontend files labels Jun 26, 2024
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

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

  • I rebased this on main and fixed some conflicts. You can do git pull --rebase to sync locally.
  • I created a new component for the no board board context menu so we don't need to worry about whether or not there is a board.

Despite knowing that I can't archive the auto-add board, this immediately threw me for a loop. It took me 10 minutes reading through the code before I realized why I couldn't archive 😅 Doesn't feel right that I cannot archive the board I'm currently reviewing (when selected for auto-add).

I'm not sure it really does much, anyways. The auto-add board is baked into each graph, so you could queue up generations to a given board and then archive it. You could also delete the board after queuing, which I'd expect to result in runtime errors. Maybe it shouldn't be baked in.

We can think more on this as we work through the rest of the gallery changes if you want to get this PR in. Maybe we should revise the auto-add behaviour.

@maryhipp
Copy link
Collaborator Author

Agreed re auto-add interactions - I pushed up 7797a34 which just checks on archive or archive view changes if the currently selected auto-add board is visible. If its not, it changes auto-ad to the Uncategorized board.

maryhipp and others added 17 commits June 28, 2024 09:26
…ery settings to show/hide archived boards in list
Much easier to not need to handle the board being optional in the component.
…o-add board is not currently visible due to archived view
…exist

Before this change, if you attempt to create an image that with a nonexistent board, we'd get an unhandled error when adding the image to a board. The record would be created, but file not, due to the structure of the code.

With this change, we now log a warning if we have a problem adding the image to the board, but the record and file are still created.

A future improvement would be to create a transaction for this part of the code, preventing some other situation that could result in only the record or only the file beings saved.
Looks like in the latest version of ruff, E721 was added or changed and now catches something it didn't before.
If the currently selected or auto-add board is archived or deleted, we should reset them. There are some edge cases taht weren't handled in the previous implementation.

All handling of this logic is moved to the (renamed) listener.
@psychedelicious
Copy link
Collaborator

psychedelicious commented Jun 27, 2024

  • Fixed merge conflicts related to a different PR getting dibs on migration 12.
  • Handle ruff error.
  • Handle edge case where a missing board could result in an image record being created but the file not saved.
  • Handle edge cases that could result in a nonexistent board being selected or set as the auto-add board.
  • Make BoardRecord.archived a required field & update frontend types

@github-actions github-actions bot added the python-tests PRs that change python tests label Jun 28, 2024
@psychedelicious psychedelicious merged commit 41f46b8 into main Jun 28, 2024
14 checks passed
@psychedelicious psychedelicious deleted the maryhipp/archive-boards branch June 28, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api frontend PRs that change frontend files python PRs that change python files python-tests PRs that change python tests services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement]: Archive Boards
2 participants