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): optimized boards queries #6603

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

psychedelicious
Copy link
Collaborator

@psychedelicious psychedelicious commented Jul 12, 2024

Summary

Optimize board related queries, reducing the number of SQL queries and network requests needed to list boards.

  • Add method and endpoint to get uncategorized image counts
  • Update board methods to use single queries to retrieve single and multiple boards
  • Update UI to use the new endpoint

Fixes incorrect board image counts.

Related Issues / Discussions

n/a

QA Instructions

The UI should list boards and their counts accurately, and moving images around in a board should work as it did before.

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 python-tests PRs that change python tests labels Jul 12, 2024
Base automatically changed from psyche/feat/ui/gallery-followups to main July 12, 2024 04:25
…cover image

This _substantially_ reduces the number of queries required to list all boards. A single query now gets one, all, or a page of boards, including counts and cover image name.

- Add helpers to build the queries, which share a common base with some joins.
- Update `BoardRecord` to include the counts.
- Update `BoardDTO`, which is now identical to `BoardRecord`. I opted to not remove `BoardDTO` because it is used in many places.
- Update boards high-level service and board records services accordingly.
chore(ui): typegen
@psychedelicious
Copy link
Collaborator Author

  • Addressed feedback, organizing objects.
  • Added comments to queries.
  • Removed extraneous condition in query.

Copy link
Collaborator

@maryhipp maryhipp left a comment

Choose a reason for hiding this comment

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

LGTM!

@psychedelicious psychedelicious marked this pull request as draft July 15, 2024 21:12
@psychedelicious
Copy link
Collaborator Author

Marked draft to prevent premature merge.

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.

3 participants