This guide explains how the navigation mode system works in TizenPortal and how to configure it at different levels.
TizenPortal supports three navigation modes:
The system uses a priority-based approach to determine which mode to use, allowing:
Best for: Most use cases, irregular layouts, content-heavy sites, modern TV UIs
Cone-based, forgiving navigation using the new spatial-navigation.js library:
Use when:
Configuration options:
{
coneAngle: 30, // ±30° default
primaryWeight: 1, // Distance along direction
secondaryWeight: 0.5, // Offset perpendicular
overlapBonus: true, // Favor overlapping elements
rowColumnBias: true, // Prefer staying in row/column
fallback: 'nearest' // 'none' | 'nearest' | 'wrap'
}
Best for: Perfect grids, uniform layouts, mathematically precise navigation
Strict axis-aligned navigation using the new spatial-navigation.js library:
Use when:
Not ideal for:
Best for: Testing, backwards compatibility, fallback only
The legacy spatial-navigation-polyfill.js (third-party script):
Use when:
Navigation mode can be configured at three levels:
| Level | Location | Scope | Override |
|---|---|---|---|
| Global | Preferences | All sites by default | Can be overridden |
| Per-Site | Site Editor | Specific site only | Overrides global |
| Bundle | Bundle Manifest | Sites using bundle | Can override or be overridden |
The system uses a strict priority order to determine the effective navigation mode:
1. Bundle Required Mode (highest priority - cannot override)
↓
2. Site Override (if configured)
↓
3. Bundle Preferred Mode (suggestion only)
↓
4. Global Default (lowest priority)
Example 1: No overrides
Global: polyfill
Site: (not configured)
Bundle: directional (preferred)
→ Result: directional ✓
Example 2: User overrides
Global: geometric
Site: polyfill
Bundle: directional (preferred)
→ Result: polyfill ✓ (site override wins)
Example 3: Bundle requires
Global: polyfill
Site: geometric
Bundle: directional (required)
→ Result: directional ✓ (required cannot be overridden)
Config location: localStorage['tp-configuration']
{
"tp_features": {
"navigationMode": "geometric"
}
}
Geometric mode is now the global default because it is currently more functionally stable.
Switch to directional when a site’s layout is irregular or geometric feels too rigid.
Config location: Card object
{
"id": "my-site",
"name": "My Site",
"url": "https://example.com",
"navigationMode": "directional"
}
Override to Geometric:
Situation: Site has perfect grid but bundle suggests directional
Action: Set site navigationMode to "geometric"
Result: Uses geometric for this site, bundle suggestion ignored
Override to Polyfill:
Situation: Bundle suggests directional but you prefer traditional navigation
Action: Set site navigationMode to "polyfill"
Result: Uses polyfill for this site
Bundles can configure navigation preferences in their manifest.json:
Simple string (preferred mode):
{
"name": "my-bundle",
"navigationMode": "directional"
}
Object with required flag:
{
"name": "my-bundle",
"navigationMode": {
"mode": "directional",
"required": false
}
}
| Field | Type | Description |
|---|---|---|
mode |
string | "polyfill", "geometric", or "directional" |
required |
boolean | true = cannot be overridden, false = suggestion only |
Use required: true when:
Use required: false or omit when:
| Bundle | Mode | Required | Reason |
|---|---|---|---|
| default | (none) | - | Uses global/site setting |
| audiobookshelf | (none) | - | Uses global/site setting |
| adblock | (none) | - | Uses global/site setting |
| userscript-sandbox | (none) | - | Uses global/site setting |
Note: No built-in bundles use polyfill mode. The new library (geometric/directional) is preferred for all cases.
Scenario: You’re using Audiobookshelf, which has mixed card sizes (square books, wide series).
Configuration:
Global: geometric (default)
Site: (not configured)
Bundle: (no preference)
Result: Uses geometric mode
How it works:
Scenario: A site has a perfect grid layout, you want strict geometric navigation.
Configuration:
Result:
Global: geometric (default)
Site: geometric
Bundle: directional (preferred) // if using custom bundle
→ Effective: geometric ✓
Site override (priority 2) beats bundle preference (priority 3).
Scenario: You’re developing a bundle that relies on directional mode’s overlap detection.
Bundle manifest:
{
"name": "my-media-bundle",
"navigationMode": {
"mode": "directional",
"required": true
}
}
Result:
Global: polyfill
Site: geometric
Bundle: directional (required)
→ Effective: directional ✓
Bundle required (priority 1) overrides everything.
Questions to ask:
required: truerequired: false or omitAdd to manifest.json:
{
"name": "my-bundle",
"displayName": "My Bundle",
"version": "1.0.0",
"navigationMode": {
"mode": "directional",
"required": false
}
}
Document in your bundle README:
## Navigation
This bundle prefers **directional mode** for optimal navigation
on [Site Name]'s irregular card layouts. Users can override
this in site settings if desired.
Symptom: Navigation goes to unexpected elements
Possible causes:
Solutions:
Symptom: Changing mode in preferences or site editor has no effect
Possible cause: Bundle has required: true
Solution:
navigationMode.requiredSymptom: Geometric or directional mode falls back to polyfill
Possible causes:
Solutions:
Symptom: Portal navigation works, site navigation doesn’t
Possible causes:
Solutions:
For advanced use cases, the navigation system exposes an API:
// Get current navigation mode
TizenPortal.navigation.getCurrentMode()
// Returns: 'polyfill' | 'geometric' | 'directional'
// Check if spatial navigation library is available
TizenPortal.navigation.isSpatialNavigationLibraryAvailable()
// Returns: boolean
// Manually apply navigation mode (advanced)
TizenPortal.navigation.applyNavigationMode(card, bundle)
Key Takeaways:
Quick Reference:
| Scenario | Recommended Mode |
|---|---|
| Default for new users | Geometric (automatically set) |
| Most sites | Geometric (strict axis-aligned) |
| Perfect grids/settings | Geometric (strict axis-aligned) |
| Backwards compatibility | Polyfill (only if needed) |
| Irregular layouts | Directional (handles imperfect alignment) |
| Media libraries | Start Geometric, switch to Directional if needed |
| Testing/debugging | Polyfill (to compare with legacy) |
For more information:
docs/Bundle-Navigation-Guide.mddocs/development/NAVIGATION-COMPATIBILITY-SUMMARY.mdnavigation/README.md