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

42 Add button to show picked items in list #61

Merged
merged 6 commits into from
May 17, 2023

Conversation

brokelyn
Copy link
Collaborator

No description provided.

@brokelyn brokelyn requested a review from nilsalm May 11, 2023 07:06
@brokelyn brokelyn linked an issue May 11, 2023 that may be closed by this pull request
Copy link
Owner

@nilsalm nilsalm left a comment

Choose a reason for hiding this comment

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

Looks good but please adjust the query as it will break soon otherwise

@@ -12,7 +12,7 @@ export const currentUser = writable(pb.authStore.model);

export async function getItemsInListQuery(listId: string) {
const { items } = await pb.collection('items').getList<Item>(1, 100, {
Copy link
Owner

Choose a reason for hiding this comment

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

this query only return 100 items and not paginated. I think it would be better to leave the query as is and add another query that actually handles all items well. This of course on the assumption that one would never have more than 100 unpicked items in the shopping list, which is realistic, but the list of all items is ever growing and will exceed 100 soon. But if we upgrade the query anyways then we might as well use it for the picked items too i suppose 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Owner

@nilsalm nilsalm left a comment

Choose a reason for hiding this comment

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

i'm still really unsure about that query and if it's not just gonna mess with the app's every day performance...

@@ -11,7 +11,7 @@ export const pb = new PocketBase(PUBLIC_POCKETBASE_URL);
export const currentUser = writable(pb.authStore.model);

export async function getItemsInListQuery(listId: string) {
const { items } = await pb.collection('items').getList<Item>(1, 100, {
const items = await pb.collection('items').getFullList<Item>({
Copy link
Owner

Choose a reason for hiding this comment

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

Have you had a look at if that's not gonna become pretty big and slow quite soon too? I think the app refreshes the list of unpicked items fairly often but if we query ALL the items every time that's gonne be slow right? maybe it should be two different queries after all?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

then we should not fetch the list so often maybe? I thought it would not be fetched that often. I will check how often that is :D
otherwise that are not too many items/kilobytes even if you have a 1000 items.

In addition if we dont allow duplication like in #60 it should be even less

Copy link
Owner

Choose a reason for hiding this comment

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

The list is fetched on every change (i think) because we haven't gotten to a local state yet. This is also noticable in #36 so querying ALL items would (for now) make this problem even worse. I also dont see what's the real argument against having two queries, they have different uses and are not duplicating themselves, no??

Copy link
Owner

@nilsalm nilsalm left a comment

Choose a reason for hiding this comment

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

let's try this one for real and see if it affects performance over time (or not) 🚀

@brokelyn brokelyn merged commit 81fa8e9 into dev May 17, 2023
nilsalm added a commit that referenced this pull request May 24, 2023
* General improvements all over the app (#40)

* Add pocketbase file to gitignore

* Update favicon to fruit

* Make home button fully clickable and not just the text

* Refactor nav buttons into component

* Undo gitignore changes

* Update the readme to avoid same startup bug

* Add new sub category for template lists

* Update template sign inside list

* Increase hitbox of items for clicks

* Add small hover effect for lists

* Add profile information on the profile page

* Fix requested stuff in PR comments

* Add models (#39)

* Add models

* Add models

* add deepClone util

* Add model to /profile

* Add model to /lists

* Add queries to list page

* Add query to /edit

* Small fixes

* fix: add quantity ti item query

* Simplify models

* remove comments

* 28 safely delete lists (#43)

* Make query safe

* Fix small bug

* Remove dead code

* Add a modal to improve deleting lists

* Apply improved pattern to category deleting

* 41 make category optional (#45)

* Update schema

* Add and show items without category

* Let the user update an item category

* Add animation when adding and deleting items from the list (#50)

* Add pocketbase to gitignore

* Add animation for adding and removing items

* Redesign navbar  for mobile first design (#44)

* Add footer navigation bar

* Update list design and breakpoints

* Add dummy category page

* Add some padding to lists page

* Add 3 input modes to item editor

* Adjust the bottom offset to always show whole list

* Add enum to item editor state

* Update name of enum

* Add logo images and include as component (#52)

* Add logo images and include as component

* Update favicon

* remove unused PNG

* Include Logo

* Fix image in readme

* Update readme with colorscheme

* Add Icon component (#64)

* 55 Add toggle button to footer (#59)

* Update footer to new design

* Add store to toggle item adder

* Add planning mode toggle to category page

* Remove categories from profile

* Add placeholder page to templates route

* Fix pr review things

* Remove bold font from mode toggler

* Fix the auto-increase overriding adding a similar item (#65)

* 42 Add button to show picked items in list (#61)

* Add button to show picked items

* Update item query to fetch all items

* Update item query with picked parameter

* Update query params to fetch picked items

* Remove console output

* Style footer navbar (#66)

* Style footer navbar

* Remove titles, improve visibility

* Move log out from topbar to profile page (#72)

* Handle registration errors with error message instead of 500 (#70)

* 35 make categories editable to rename them (#73)

* Make category editable on own page

* Add some stats

* 62 fix jumping animation when deleting items (#67)

* Add button to show picked items

* Update item query to fetch all items

* Merge

* 63 remove email from registration and move to username only (#75)

* Update register form to use username

* Update login page to use username

* Add new pb schema file

* 7 enable ordering categories (#76)

* Add order to category model

* Add order to update form

* Remove old modal

* Query categories ordered

* revert useless change

* refactor category item

* Update category order on desktop

* style

* update pb schema

* update schema

* 74 wrap duplicated layouts into component (#77)

* Add new layout container everywhere

* Remove unused planning mode

* Fix mobile design

* Add conditon for padding to layoutcontainer

* Only add padding when on list id page

* Remove unused code

* 36 increasingdecreasing the quantity of items is really slow (#82)

* Make item adding quicker

* change formactions to functions

---------

Co-authored-by: Philipp Krause <phil.fhs11@googlemail.com>
nilsalm added a commit that referenced this pull request Jan 22, 2024
* General improvements all over the app (#40)

* Add pocketbase file to gitignore

* Update favicon to fruit

* Make home button fully clickable and not just the text

* Refactor nav buttons into component

* Undo gitignore changes

* Update the readme to avoid same startup bug

* Add new sub category for template lists

* Update template sign inside list

* Increase hitbox of items for clicks

* Add small hover effect for lists

* Add profile information on the profile page

* Fix requested stuff in PR comments

* Add models (#39)

* Add models

* Add models

* add deepClone util

* Add model to /profile

* Add model to /lists

* Add queries to list page

* Add query to /edit

* Small fixes

* fix: add quantity ti item query

* Simplify models

* remove comments

* 28 safely delete lists (#43)

* Make query safe

* Fix small bug

* Remove dead code

* Add a modal to improve deleting lists

* Apply improved pattern to category deleting

* 41 make category optional (#45)

* Update schema

* Add and show items without category

* Let the user update an item category

* Add animation when adding and deleting items from the list (#50)

* Add pocketbase to gitignore

* Add animation for adding and removing items

* Redesign navbar  for mobile first design (#44)

* Add footer navigation bar

* Update list design and breakpoints

* Add dummy category page

* Add some padding to lists page

* Add 3 input modes to item editor

* Adjust the bottom offset to always show whole list

* Add enum to item editor state

* Update name of enum

* Add logo images and include as component (#52)

* Add logo images and include as component

* Update favicon

* remove unused PNG

* Include Logo

* Fix image in readme

* Update readme with colorscheme

* Add Icon component (#64)

* 55 Add toggle button to footer (#59)

* Update footer to new design

* Add store to toggle item adder

* Add planning mode toggle to category page

* Remove categories from profile

* Add placeholder page to templates route

* Fix pr review things

* Remove bold font from mode toggler

* Fix the auto-increase overriding adding a similar item (#65)

* 42 Add button to show picked items in list (#61)

* Add button to show picked items

* Update item query to fetch all items

* Update item query with picked parameter

* Update query params to fetch picked items

* Remove console output

* Style footer navbar (#66)

* Style footer navbar

* Remove titles, improve visibility

* Move log out from topbar to profile page (#72)

* Handle registration errors with error message instead of 500 (#70)

* 35 make categories editable to rename them (#73)

* Make category editable on own page

* Add some stats

* 62 fix jumping animation when deleting items (#67)

* Add button to show picked items

* Update item query to fetch all items

* Merge

* 63 remove email from registration and move to username only (#75)

* Update register form to use username

* Update login page to use username

* Add new pb schema file

* 7 enable ordering categories (#76)

* Add order to category model

* Add order to update form

* Remove old modal

* Query categories ordered

* revert useless change

* refactor category item

* Update category order on desktop

* style

* update pb schema

* update schema

* 74 wrap duplicated layouts into component (#77)

* Add new layout container everywhere

* Remove unused planning mode

* Fix mobile design

* Add conditon for padding to layoutcontainer

* Only add padding when on list id page

* Remove unused code

* 36 increasingdecreasing the quantity of items is really slow (#82)

* Make item adding quicker

* change formactions to functions

* update schema to avoid merge conflicts

* 84 fix login/registration does not trim username string (#85)

* Fix trim login issue

* Fix trim registrer issue

* 53 fix wrong alignment of item buttons (#86)

* Remove width calculation and use flex grow

* Remove useless div and flex

* update README (#90)

* 87 make email great again (#89)

* add email for registration and login

* add username update

* improve error handling

* 9 share list with other users backenddata (#92)

* Update Schema

* change user to owner

* 68 add reset password form (#94)

* Add password reset page

* Refactor title out of the form

* Remove console log

* Fix typo

* Update text messages

* Remove buttons from footer and add category button to profile (#97)

* adds invitation functionality (#99)

* 58 accept invitation to list 1 (#107)

* remove user from list

* update schema

* accept/decline invitations

* remove unused data

* remove unused code

* improve invitation sending

* share categories

* simplify query

* add unfollow list

* remove dead code

* add icon on template

* Rename Component List to ListButton

* update fly-config for V2

---------

Co-authored-by: Philipp Krause <phil.fhs11@googlemail.com>
nilsalm added a commit that referenced this pull request Jan 23, 2024
* General improvements all over the app (#40)

* Add pocketbase file to gitignore

* Update favicon to fruit

* Make home button fully clickable and not just the text

* Refactor nav buttons into component

* Undo gitignore changes

* Update the readme to avoid same startup bug

* Add new sub category for template lists

* Update template sign inside list

* Increase hitbox of items for clicks

* Add small hover effect for lists

* Add profile information on the profile page

* Fix requested stuff in PR comments

* Add models (#39)

* Add models

* Add models

* add deepClone util

* Add model to /profile

* Add model to /lists

* Add queries to list page

* Add query to /edit

* Small fixes

* fix: add quantity ti item query

* Simplify models

* remove comments

* 28 safely delete lists (#43)

* Make query safe

* Fix small bug

* Remove dead code

* Add a modal to improve deleting lists

* Apply improved pattern to category deleting

* 41 make category optional (#45)

* Update schema

* Add and show items without category

* Let the user update an item category

* Add animation when adding and deleting items from the list (#50)

* Add pocketbase to gitignore

* Add animation for adding and removing items

* Redesign navbar  for mobile first design (#44)

* Add footer navigation bar

* Update list design and breakpoints

* Add dummy category page

* Add some padding to lists page

* Add 3 input modes to item editor

* Adjust the bottom offset to always show whole list

* Add enum to item editor state

* Update name of enum

* Add logo images and include as component (#52)

* Add logo images and include as component

* Update favicon

* remove unused PNG

* Include Logo

* Fix image in readme

* Update readme with colorscheme

* Add Icon component (#64)

* 55 Add toggle button to footer (#59)

* Update footer to new design

* Add store to toggle item adder

* Add planning mode toggle to category page

* Remove categories from profile

* Add placeholder page to templates route

* Fix pr review things

* Remove bold font from mode toggler

* Fix the auto-increase overriding adding a similar item (#65)

* 42 Add button to show picked items in list (#61)

* Add button to show picked items

* Update item query to fetch all items

* Update item query with picked parameter

* Update query params to fetch picked items

* Remove console output

* Style footer navbar (#66)

* Style footer navbar

* Remove titles, improve visibility

* Move log out from topbar to profile page (#72)

* Handle registration errors with error message instead of 500 (#70)

* 35 make categories editable to rename them (#73)

* Make category editable on own page

* Add some stats

* 62 fix jumping animation when deleting items (#67)

* Add button to show picked items

* Update item query to fetch all items

* Merge

* 63 remove email from registration and move to username only (#75)

* Update register form to use username

* Update login page to use username

* Add new pb schema file

* 7 enable ordering categories (#76)

* Add order to category model

* Add order to update form

* Remove old modal

* Query categories ordered

* revert useless change

* refactor category item

* Update category order on desktop

* style

* update pb schema

* update schema

* 74 wrap duplicated layouts into component (#77)

* Add new layout container everywhere

* Remove unused planning mode

* Fix mobile design

* Add conditon for padding to layoutcontainer

* Only add padding when on list id page

* Remove unused code

* 36 increasingdecreasing the quantity of items is really slow (#82)

* Make item adding quicker

* change formactions to functions

* update schema to avoid merge conflicts

* 84 fix login/registration does not trim username string (#85)

* Fix trim login issue

* Fix trim registrer issue

* 53 fix wrong alignment of item buttons (#86)

* Remove width calculation and use flex grow

* Remove useless div and flex

* update README (#90)

* 87 make email great again (#89)

* add email for registration and login

* add username update

* improve error handling

* 9 share list with other users backenddata (#92)

* Update Schema

* change user to owner

* 68 add reset password form (#94)

* Add password reset page

* Refactor title out of the form

* Remove console log

* Fix typo

* Update text messages

* Remove buttons from footer and add category button to profile (#97)

* adds invitation functionality (#99)

* 58 accept invitation to list 1 (#107)

* remove user from list

* update schema

* accept/decline invitations

* remove unused data

* remove unused code

* improve invitation sending

* share categories

* simplify query

* add unfollow list

* remove dead code

* add icon on template

* Rename Component List to ListButton

* update fly-config for V2

* updated fly config

* 111 improve planning mode (#114)

* change available actions for shop and plan mode

* Update icons

* Improve amount handling (#118)

---------

Co-authored-by: Philipp Krause <phil.fhs11@googlemail.com>
@nilsalm nilsalm deleted the 42-add-a-button-to-show-all-hidden-items branch January 24, 2024 08:30
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.

Add a button to show all "hidden" items
2 participants