Port the full-page and navigation tiles into the Vue editor (for 0.2.74)

Sizes single, wide and full in web/src/model/layout.ts (a full tile covers the six cells of a page and starts
it; packing, fitting, arranging and page counting know it), the full card on the mockup, Size with Full page
and its firmware hint in the tile drawer, controls defaulting to none on a full tile, navigation tiles
(screen.page_1..8: Goes to page, size normal or double, icon and colour only, "Page n ›" on the card), the
tile limit of 48 from firmware 0.2.62, the "Screen" domain label. Vitest and the Python source tests cover it.
The add-on side of this round lives on the peer branch fullpage (4be6153).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-18 08:39:28 +02:00
parent 1ed42dc425
commit 00c9a4e4f3
17 changed files with 300 additions and 101 deletions
+11
View File
@@ -144,6 +144,17 @@ class Editor(unittest.TestCase):
for marker in ('class="whatsnew"', 'role="progressbar"', "go('#firmware')"):
self.assertIn(marker, self.page, marker)
def test_full_page_and_navigation_tiles_are_in_the_editor(self):
import editor_sources
layout = editor_sources.source('model/layout.ts')
for marker in ('export const SIZES: Size[] = ["single", "wide", "full"];', 'export const pageTarget', 'versionAtLeast(firmware, "0.2.62") ? MAX_TILES'):
self.assertIn(marker, layout, marker)
drawer = editor_sources.component('TileInspector')
for marker in ('["full", "Full page"]', 'Goes to page', 'retargetPageTile(tile, Number(v))'):
self.assertIn(marker, drawer, marker)
self.assertIn(':class="{ wide, full, bare, placeholder: placeholder || !live, chosen }"', editor_sources.component('TileCard'))
self.assertIn('["screen", "Screen"]', editor_sources.component('Library'))
if __name__ == '__main__':
unittest.main()
+1 -1
View File
@@ -228,7 +228,7 @@ class Editor(unittest.TestCase):
def test_perform_action_is_a_tap_choice_with_home_assistants_list(self):
self.assertIn('list.push(["action", "Perform action"]);', self.SCRIPT)
self.assertIn('getJson(`entity-actions?entity=${encodeURIComponent(entity)}`)', self.SCRIPT)
self.assertIn('<ActionPicker v-if="domain !== \'screen\' && tap === \'action\'" :tile="tile" />', self.SCRIPT)
self.assertIn('<ActionPicker v-if="domain !== \'screen\' && !goesTo && tap === \'action\'" :tile="tile" />', self.SCRIPT)
# Fields follow Home Assistant's selectors; an empty field is left out of the data.
for marker in ("kindOf(field) === 'boolean'", "kindOf(field) === 'number' || kindOf(field) === 'color_temp'", 'config.options', 'delete data[key]'):
self.assertIn(marker, self.PICKER, marker)