-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
changeable items per table page #185
Conversation
WalkthroughWalkthroughThe recent modifications introduce a pagination feature to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TableComponent
participant Preferences
User->>TableComponent: Selects rows per page
TableComponent->>Preferences: Update rowsPerPage
Preferences-->>TableComponent: Save user preference
TableComponent->>User: Display updated table
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (1)
frontend/composables/use-preferences.ts (1)
28-28
: Splendid implementation, Mr. Stark.Setting the default value for
itemsPerTablePage
to10
ensures a seamless user experience. However, consider documenting this default behavior in the function's comments for clarity and future maintenance.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- frontend/components/Item/View/Table.vue (2 hunks)
- frontend/composables/use-preferences.ts (2 hunks)
Additional comments not posted (1)
frontend/composables/use-preferences.ts (1)
12-12
: Excellent addition, Sir.The inclusion of
itemsPerTablePage
as a number in theLocationViewPreferences
type is a prudent choice, enhancing user customization capabilities. Well done.
Comments failed to post (3)
frontend/components/Item/View/Table.vue (3)
66-73: Enhanced Pagination Controls
Sir, the addition of a dynamic pagination control is a commendable enhancement. It allows users to select the number of rows per page, which is a significant improvement in user interface flexibility. The implementation checks if the items exceed ten before rendering the controls, which is a logical approach to avoid unnecessary UI elements when not needed.
However, I would recommend adding a tooltip or some form of user guidance on the dropdown to enhance accessibility and inform users about the functionality. This small addition could significantly improve the user experience by making the interface more intuitive.
107-108: Initialization of Pagination State with User Preferences
Master Stark, the initialization of
rowsPerPage
usingpreferences.value.itemsPerTablePage
is a strategic improvement. It tailors the user experience by respecting individual preferences, which is crucial for user retention and satisfaction.However, it is essential to ensure that
preferences.value.itemsPerTablePage
is always within the valid range of options (10, 25, 50, 100). If a user's preference is set outside these bounds, it could lead to unexpected behavior. I suggest implementing a validation mechanism to correct such discrepancies.Consider adding a validation step to ensure the
rowsPerPage
value falls within the expected range. This can prevent potential errors and enhance data integrity.+ if (![10, 25, 50, 100].includes(pagination.rowsPerPage)) { + pagination.rowsPerPage = 10; // Default to 10 if out of bounds + }Also applies to: 112-112
116-121: Watcher to Update User Preferences
The implementation of a watcher to update user preferences when
rowsPerPage
changes is a forward-thinking feature, ensuring that user settings are preserved across sessions. This is particularly useful for enhancing the user experience by maintaining consistency in user interactions.However, I would advise adding error handling around the preference update operation. It's prudent to prepare for scenarios where the preference update might fail, perhaps due to network issues or data validation errors on the server side.
Add error handling to the preference update logic to ensure robustness and reliability.
+ try { + preferences.value.itemsPerTablePage = newRowsPerPage; + } catch (error) { + console.error('Failed to update user preferences:', error); + }Committable suggestion was skipped due to low confidence.
… v0.14.1@d5d85af by renovate (#26007) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/sysadminsmedia/homebox](https://redirect.github.com/sysadminsmedia/homebox) | patch | `0.14.0` -> `0.14.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>sysadminsmedia/homebox (ghcr.io/sysadminsmedia/homebox)</summary> ### [`v0.14.1`](https://redirect.github.com/sysadminsmedia/homebox/releases/tag/v0.14.1) [Compare Source](https://redirect.github.com/sysadminsmedia/homebox/compare/v0.14.0...v0.14.1) #### What's Changed - fixes regional localization not working properly [@​tankerkiller125](https://redirect.github.com/tankerkiller125) - additional languages - styles on home page by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/193](https://redirect.github.com/sysadminsmedia/homebox/pull/193) - improve creation modals by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/196](https://redirect.github.com/sysadminsmedia/homebox/pull/196) - compare SearchFilter values on a unique field instead of by reference for finding unselected by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/195](https://redirect.github.com/sysadminsmedia/homebox/pull/195) - improve multiselect by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/197](https://redirect.github.com/sysadminsmedia/homebox/pull/197) - changeable items per table page by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/185](https://redirect.github.com/sysadminsmedia/homebox/pull/185) #### New Contributors - [@​tonyaellie](https://redirect.github.com/tonyaellie) made their first contribution in [https://github.com/sysadminsmedia/homebox/pull/193](https://redirect.github.com/sysadminsmedia/homebox/pull/193) **Full Changelog**: sysadminsmedia/homebox@v0.14.0...v0.14.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43MC4wIiwidXBkYXRlZEluVmVyIjoiMzguNzAuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJhdXRvbWVyZ2UiLCJ1cGRhdGUvZG9ja2VyL2dlbmVyYWwvbm9uLW1ham9yIl19-->
What type of PR is this?
feature
What this PR does / why we need it:
Allows for the number of items displayed per page in the items view table to be changed.
Which issue(s) this PR fixes:
Fixes #183
Summary by CodeRabbit
New Features
Improvements