From e13fa6ca5109e2e24a2c9e7a97232c6ca17382f6 Mon Sep 17 00:00:00 2001 From: DerEchteAlec Date: Thu, 13 Aug 2026 22:33:02 +0200 Subject: [PATCH] ENH - migrate Home Screen widgets to Sky UI --- .../SpringboardWidget.contract.test.ts | 49 + frontend/src/components/SpringboardWidget.vue | 926 +++++++++++++----- frontend/src/services/widgetServices.ts | 14 +- frontend/src/stores/phone.ts | 2 + sky_phone/config/locales/en.lua | 4 +- 5 files changed, 738 insertions(+), 257 deletions(-) create mode 100644 frontend/src/components/SpringboardWidget.contract.test.ts diff --git a/frontend/src/components/SpringboardWidget.contract.test.ts b/frontend/src/components/SpringboardWidget.contract.test.ts new file mode 100644 index 0000000..46d8cb0 --- /dev/null +++ b/frontend/src/components/SpringboardWidget.contract.test.ts @@ -0,0 +1,49 @@ +import { readFileSync } from 'node:fs' + +import { describe, expect, it } from 'vitest' + +const source = readFileSync( + new URL('./SpringboardWidget.vue', import.meta.url), + 'utf8', +) + +describe('SpringboardWidget UI contract', () => { + it('uses the Sky widget frame without a Konsta surface', () => { + expect(source).toContain(' { + expect(source).toContain('class="home-widget-open"') + expect(source).toContain('@click.stop="openWidget"') + expect(source).toContain('position: absolute;') + expect(source).toContain('background: transparent;') + }) + + it('shows the reactive clock time in the calendar header', () => { + expect(source).toContain('class="widget-date-time"') + expect(source).toContain('{{ clock.time.value }}') + expect(source).toContain('font-variant-numeric: tabular-nums;') + }) + + it('reuses weather artwork and music metadata from the owning apps', () => { + expect(source).toContain(' { + expect(source).toContain(`data-weather-condition='${condition}'`) + }) +}) diff --git a/frontend/src/components/SpringboardWidget.vue b/frontend/src/components/SpringboardWidget.vue index a69d3d1..ddf5379 100644 --- a/frontend/src/components/SpringboardWidget.vue +++ b/frontend/src/components/SpringboardWidget.vue @@ -1,25 +1,19 @@