-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement Sheet State - Phase 1 #17
Labels
Comments
5 tasks
kgar
added a commit
that referenced
this issue
Nov 8, 2023
…ilter Texts (#33) * Began implementing current tab caching support. * Attempting scrollY tracking with the built-in stuff. * Finished adding support for scrollY tracking in the style of default 5e sheets. Corrected sheet render return types. Adjusted some of the layout to allow for more streamlined tracking of scrollY. Replaced some overreaching global styles with more component-/module-bound alternatives. * Replaced ListContainer component with a simple div with layout class "scroll-container". It's more transparent and removes some additional SCSS ceremony to fold in more local styles with the target scroll container. * Added useTransition option to ItemSummary to allow for rehydrating cached data without unintended delay time in rendering. Without this, scrollY would have trouble restoring because of a different scroll top due to unexpanded items waiting their configured delay. Implemented expanded item caching between renders and ensured it respects srollY cache restore as well. * Updated ItemFilterSearch to leverage a `searchFilters` map from context and to provide a `filterId` for caching to the map. Updated each of the sheet types to support searchFilter caching. * Refactored cacheable interfaces to exclude implementation details like how the cache data is held. Removed search filter cacheability from Vehicles. Will add back if they ever get search. Refactored so that mutations to cache data require a function call. This, and the interface changes, are to prepare for side-effecting persistence mechanisms 👀 * Fixed disabled input issue in Favorites for ItemUses. * Converted personality info toggle to a button. * Added location awareness to components via the Context API. Location awareness is opt-in and builds a path string representing where in the sheet we currently are. It is not tied to all components; it is conceptually tied to "locations," such as "Within the Attributes Tab." Leveraged location awareness to support independent cached item expansion restoration. Took over item expansion to do it custom, because location-aware cache restoring of expanded items is otherwise not feasible. Implemented location-aware expanded item caching and cache restore for player characters. * Implemented location-aware expanded item caching to NPCs and Vehicles. * Converted search filter caching to use location awareness and to remove the required filterId. * Extracted location declaration to a utility function. * Removed item window auto-resize. If the community really wants it, it can be added back later via a fresh approach. Adjusted some types. * Renamed item caching props for conciseness. Renamed types for clarity. Cleaned up unused context data. * Renamed interfaces for clarity. * Move interface implementation to bottom of sheet with comment header.
All done 👏 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement sheet state tracking.
Note
Phase 1: Track it on the sheet and don't worry about persisting between full browser tab reloads.
Use the application subclass / base class features to track:
_expanded
set accordingly.getData()
and emit search filter changes from svelte to the sheet through a contextual function.expandedData
approach, expanded items are tracked by item ID, which means when I expand a favorited item on its main tab and then close/reopen the sheet, the same item will be expanded on its own tab and in favorites. This will definitely lead to some confusion. Devise an approach that allows for differentiating items by an additional dimension, such as the tab ID.If something cannot be captured while it is happening, I will attempt to capture it on component destruction. Components are destroyed before a full re-render and when the application is closed, so this particular time is the last moment where we can peer into the state of the sheet before it's gone.
The text was updated successfully, but these errors were encountered: