All files screens.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 4/4
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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          2x                           2x                                                                               18x     9x 22x      
// Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
/** The screen table: one place the tab bar, the router and the parity check all read. Declared by `interfaces/screens-interface.ts`. */
import type { ParityFeature, ScreenSpec, ScreensInterface } from './interfaces/screens-interface';
 
export class Screens implements ScreensInterface {
  static readonly FEATURES: readonly ParityFeature[] = [
    'projects-and-phases',
    'gates',
    'lanes-live',
    'loop-engine-effort',
    'budgets-and-spend',
    'doctor',
    'command-palette',
    'notifications',
    'devices-and-pairing',
    'themes',
    'onboarding',
  ];
 
  readonly all: readonly ScreenSpec[] = [
    { route: '/', title: 'Home', icon: 'home', tab: true, features: ['projects-and-phases'], gaps: [] },
    { route: '/gates', title: 'Gates', icon: 'gate', tab: true, features: ['gates'], gaps: [] },
    {
      route: '/lanes',
      title: 'Lanes',
      icon: 'lanes',
      tab: true,
      features: ['lanes-live'],
      gaps: ['Stop, wind down and prompt wait for the hub routes; the list refreshes rather than streams.'],
    },
    {
      route: '/effort',
      title: 'Loops & Effort',
      icon: 'effort',
      tab: true,
      features: ['loop-engine-effort', 'command-palette'],
      gaps: ['The choice is shown and checked here; the hub has no route to start a run yet.'],
    },
    { route: '/settings', title: 'Settings', icon: 'settings', tab: true, features: ['themes', 'notifications'], gaps: [] },
    { route: '/budgets', title: 'Budgets', icon: 'budget', tab: false, features: ['budgets-and-spend'], gaps: [] },
    {
      route: '/devices',
      title: 'Devices',
      icon: 'device',
      tab: false,
      features: ['devices-and-pairing'],
      gaps: ['Listing and revoking other devices waits for the hub pairing routes.'],
    },
    { route: '/doctor', title: 'Doctor', icon: 'doctor', tab: false, features: ['doctor'], gaps: [] },
    {
      route: '/pair',
      title: 'Welcome',
      icon: 'atom',
      tab: false,
      features: ['onboarding', 'devices-and-pairing'],
      gaps: ['Pairing by QR or code waits for the hub pairing routes; the host token connects today.'],
    },
  ];
 
  readonly tabs: readonly ScreenSpec[] = this.all.filter((screen) => screen.tab);
 
  missing(): readonly ParityFeature[] {
    const carried = new Set(this.all.flatMap((screen) => screen.features));
    return Screens.FEATURES.filter((feature) => !carried.has(feature));
  }
}