Saltar al contenido principal

Views & Detection Rules

Views define where your knowledge content appears. Each view maps to a specific page or section of your application, allowing Appilot to deliver context-aware assistance.

What is a View?

A view represents a logical page or section in your application. When a user navigates to a page, Appilot uses detection rules to identify which view the user is on, then delivers the knowledge content linked to that view.

Detection Strategies

Appilot supports multiple strategies to detect the current view.

Authoring rule: prefer URL when your app exposes one. Open the target page in a normal browser tab. If the URL changes when you navigate between the views you want to distinguish, write a URL rule — it is one line, free of DOM-shape fragility, and survives target-app redesigns. DOM detection is reserved for views the URL cannot distinguish (sub-panels, sidebars, single-URL apps where the framework never updates pathname). "It is a SPA" is not a reason to skip URL: most modern SPAs (Vue Router, React Router, Nextcloud's Vue 3 router) update the URL on every navigation.

URL Pattern Matching

The simplest and most resilient strategy — matches the browser URL against patterns.

Examples:

  • /register/* matches any page directly under /register/.
  • **/apps/files/** (glob) matches the Nextcloud Files app at any nesting (used by the BeKnow demo).
  • ^/admin/users/\d+$ (regex) matches numeric user-edit pages.

DOM-based Detection

Reads a value from the DOM to determine the current page. Use only when the URL is identical across the views you want to distinguish — typical cases are sub-tabs of a same-URL page, an inline sidebar whose active tab is internal to the framework, or single-URL apps like Vaadin Flow.

Configuration:

  • Selector — A CSS selector targeting the DOM element (e.g., #breadcrumb .current, section[aria-label="Sharing"])
  • Read — What to read from the element. One of innerText, textContent, or getAttribute (combine the last with the attribute name)
  • Expected value — The value that identifies this view, and a match mode (exact, contains, regex)

SDK-reported Context

When integrating via the Widget SDK, your application can programmatically report the current view:

window.__appilot = { view: 'zufi/online-services' };
// or, dynamically on SPA navigation:
window.__appilot.setView('zufi/online-services/new');

See the SDK Integration Guide for details.

Path Hierarchy & Content Inheritance

Views follow a hierarchical path structure. Content linked to parent paths is inherited by child views:

servicios/                    → Domain-wide content
servicios/online-services/ → Inherits parent + own content
servicios/online-services/new → Inherits both parents + own content

This means you only need to define common content once at the parent level.

Detection Priority

When multiple detection rules could match, Appilot evaluates them in this order:

  1. SDK-reported context (highest priority)
  2. URL pattern
  3. DOM-based detection
  4. Page title

Within each type, rules are sorted ascending by the priority field on the rule (lower number wins). If two views match, the one with the more specific path (more segments) wins.

Health Monitoring

In the Backoffice, each view shows detection health indicators:

  • Last detected — When a user was last detected on this view
  • Never matched — Rule may need testing or the page may have changed
  • Not matched in 30+ days — Target application may have changed

Configuring Views

Views are configured through the Backoffice admin panel. See Managing Views for the admin guide.