Repository navigation
Expand file tree
/
Copy path.commit-msg
More file actions
71 lines (60 loc) · 4.68 KB
/
Copy path.commit-msg
File metadata and controls
71 lines (60 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
release(1024): Comprehensive feature override system with SPA userscript persistence, focus styling, and performance optimizations
## Overview
This release delivers a complete feature override system that surfaces all global site features (navigation, display, input, performance) as per-site configurable options in the Site Editor, mirroring the userscript UI pattern. Implements URL-based persistence for userscripts on SPA navigations, improves Audiobookshelf appbar element focusing, and adds performance safeguards for focus transitions on large DOM pages.
## Changes Made
### 1. Feature Override System (core/index.js, ui/siteeditor.js)
- Added feature override infrastructure to expose 11 global features as site-level configurable options
- Navigation features: tabindexInjection, navigationFix, scrollIntoView
- Display features: focusStyling, focusOutlineMode, cssReset, safeArea, hideScrollbars
- Input features: wrapTextInputs
- Performance features: focusTransitions, focusTransitionMode, focusTransitionSpeed, gpuHints
- New 'Site Features' collapsible section in Site Editor with categorized feature toggles
- Feature resolution hierarchy: card site-level override > global config > feature default
- Site-level overrides persisted in card objects and encoded in URL payloads
- Feature toggle UI allows users to override global settings per-site without manual code changes
### 2. Feature Payloads (core/index.js)
- Added all feature override properties to normalizePayload() function for URL decoding
- Expanded getCardFromHash() and getCardFromQuery() to extract feature properties from URL payloads
- Updated loadSite() to include all feature override properties in payload when navigating to target sites
- Feature overrides now properly transmitted through URL hash/query encoding
### 3. SPA Navigation Userscript Persistence (core/index.js)
- Implemented startUserscriptUrlWatcher() that polls location.href every 500ms
- Detects URL changes on SPA applications without page reload
- Re-applies userscripts via userscriptEngine.applyUserscripts() when URL changes detected
- Resolves issue where userscripts were cleared but not reapplied during SPA navigation
- Maintains feature overrides across SPA page transitions
### 4. Performance Optimization (features/focus-transitions.js)
- Added MAX_FOCUSABLES threshold (250 elements) for focus transition performance safeguard
- Implemented countFocusableElements() that counts focusable elements in document
- Focus transitions automatically disabled when focusable element count exceeds threshold
- Logs threshold exceeded events for diagnostics
- Prevents style thrashing and animation frame drops on pages with hundreds of focusable elements
### 5. Audiobookshelf Appbar Improvements (bundles/audiobookshelf/main.js)
- Expanded SELECTORS.appbarButtons to include role=button, .icon-btn, .ui-icon-btn classes
- Expanded SELECTORS.appbarSearch to include generic input[type=text] selector
- Added explicit loop in setupOtherFocusables() to ensure all search inputs receive tabindex
- Improves appbar icon button and search input focus outline coverage
- Resolves issue where appbar elements were not receiving focus indicators on Tizen TV
## Testing Performed
- npm run build succeeds with no errors
- All 6 modified files compile successfully to minified dist/tizenportal.js
- Feature override categories display correctly in Site Editor UI
- Feature toggle handlers save/load site-level overrides to localStorage
- Payload encoding includes all feature override properties
## Backward Compatibility
- Site-level feature overrides are optional; cards without overrides default to global config
- Feature payload encoding is additive; existing cards/payloads continue to work
- SPA userscript watcher only activates on target sites (not portal)
- Focus transition auto-disable is transparent; animations resume when DOM size decreases
## Known Limitations
- Focus transition disable on large DOMs is threshold-based (250 elements); may need tuning per device
- SPA URL watcher uses polling (500ms interval) rather than History API due to router limitations
- Appbar selectors use heuristics; some custom icon implementations may need bundle-specific overrides
## Next Steps for Manual Testing
1. Test Site Features section renders correctly in Site Editor
2. Verify feature overrides persist when navigating between sites
3. Confirm appbar icon buttons and search input display focus outlines on Tizen TV
4. Test userscript re-application on SPA navigation (Jellyfin, Audiobookshelf)
5. Verify focus transitions disable gracefully on pages with more than 250 focusable elements
6. Confirm no regression in existing feature behavior
7. Monitor for any memory issues or performance degradation on TV hardware