From d0f8538b6d2930e50fdc325492a561a0159b6ace Mon Sep 17 00:00:00 2001 From: Lukas Svoboda Date: Wed, 15 Apr 2026 13:46:23 +0200 Subject: [PATCH 1/8] Release v0.0.1 - first public release (#4) --- .github/ISSUE_TEMPLATE/bug_report.yml | 173 ++++++++++----------- .github/ISSUE_TEMPLATE/config.yml | 14 +- .github/ISSUE_TEMPLATE/feature_request.yml | 95 ++++++----- .github/ISSUE_TEMPLATE/question.yml | 41 +++-- .github/release-drafter.yml | 154 +++++++++--------- .github/workflows/ci.yml | 7 +- .github/workflows/release.yml | 7 +- .github/workflows/sync-labels.yml | 11 +- Cargo.lock | 24 +-- Cargo.toml | 14 +- src/app.rs | 27 +--- src/ha/types.rs | 1 - src/ha/ws.rs | 30 +--- src/ui/chrome.rs | 4 +- src/ui/components.rs | 55 ++++--- src/ui/entity_window.rs | 2 +- 16 files changed, 310 insertions(+), 349 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d4366c9..27ba809 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,97 +1,96 @@ - name: πŸ› Bug report - description: Report a crash or incorrect behavior in Snapdash. - labels: ["fix"] - body: - - type: markdown - attributes: - value: | - Thanks for reporting a bug! πŸ™ - Please fill in as much detail as possible β€” it helps us fix it faster. +name: πŸ› Bug report +description: Report a crash or incorrect behavior in Snapdash. +labels: ["fix"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting a bug! πŸ™ + Please fill in as much detail as possible β€” it helps us fix it faster. - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Describe what you expected vs. what actually happened. - placeholder: "I expected ... but instead ..." - validations: - required: true + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Describe what you expected vs. what actually happened. + placeholder: "I expected ... but instead ..." + validations: + required: true - - type: input - id: snapdash-version - attributes: - label: Snapdash version - description: Shown in Settings β†’ bottom status bar, or `snapdash --version` (if built from source). - placeholder: "e.g. 0.0.1" - validations: - required: true + - type: input + id: snapdash-version + attributes: + label: Snapdash version + description: Shown in Settings β†’ bottom status bar, or `snapdash --version` (if built from source). + placeholder: "e.g. 0.0.1" + validations: + required: true - - type: dropdown - id: os - attributes: - label: Operating system - options: - - macOS (Apple Silicon) - - macOS (Intel) - - Windows 10 - - Windows 11 - - Linux (X11) - - Linux (Wayland) - - Other - validations: - required: true + - type: dropdown + id: os + attributes: + label: Operating system + options: + - macOS (Apple Silicon) + - macOS (Intel) + - Windows 10 + - Windows 11 + - Linux (X11) + - Linux (Wayland) + - Other + validations: + required: true - - type: input - id: os-version - attributes: - label: OS version / distribution - placeholder: "e.g. macOS 15.4, Ubuntu 24.04, Windows 11 23H2" - validations: - required: true + - type: input + id: os-version + attributes: + label: OS version / distribution + placeholder: "e.g. macOS 15.4, Ubuntu 24.04, Windows 11 23H2" + validations: + required: true - - type: input - id: ha-version - attributes: - label: Home Assistant version (if applicable) - placeholder: "e.g. 2026.4.1" + - type: input + id: ha-version + attributes: + label: Home Assistant version (if applicable) + placeholder: "e.g. 2026.4.1" - - type: textarea - id: repro - attributes: - label: Steps to reproduce - placeholder: | - 1. Open Settings window - 2. Toggle XYZ - 3. See error ... - validations: - required: true + - type: textarea + id: repro + attributes: + label: Steps to reproduce + placeholder: | + 1. Open Settings window + 2. Toggle XYZ + 3. See error ... + validations: + required: true - - type: textarea - id: logs - attributes: - label: Relevant log output - description: | - Attach relevant lines from `debug.log`: - - macOS: `~/Library/Application Support/dev.snapdash.Snapdash/debug.log` - - Windows: `%APPDATA%\dev.snapdash.Snapdash\debug.log` - - Linux: `~/.local/share/snapdash/debug.log` + - type: textarea + id: logs + attributes: + label: Relevant log output + description: | + Attach relevant lines from `debug.log`: + - macOS: `~/Library/Application Support/dev.snapdash.Snapdash/debug.log` + - Windows: `%APPDATA%\dev.snapdash.Snapdash\debug.log` + - Linux: `~/.local/share/snapdash/debug.log` - Please anonymize tokens, IPs, or sensor data you don't want public. - render: shell + Please anonymize tokens, IPs, or sensor data you don't want public. + render: shell - - type: textarea - id: screenshots - attributes: - label: Screenshots / recordings - description: Drag & drop images or short videos here (optional). - - - type: checkboxes - id: checklist - attributes: - label: Checklist - options: - - label: I searched existing issues and discussions - required: true - - label: I'm running the latest Snapdash release - required: true + - type: textarea + id: screenshots + attributes: + label: Screenshots / recordings + description: Drag & drop images or short videos here (optional). + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I searched existing issues and discussions + required: true + - label: I'm running the latest Snapdash release + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index bf72696..bfc2640 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: false contact_links: - - name: Q&A / General discussion + - name: Q&A / General discussion url: https://github.com/schizza/snapdash/discussion about: Questions about usage, configuration tips, ideas - Issues are for bugs and feature requests only. - - name: Snapdash website - url: https://snapdash.schizza.cz - about: Documentation and downloads. - - name: Home Assistant - url: https://www.home-assistant.io/ - about: For HA-specific questions, try the Home Assistant community + - name: Snapdash website + url: https://snapdash.schizza.cz + about: Documentation and downloads. + - name: Home Assistant + url: https://www.home-assistant.io/ + about: For HA-specific questions, try the Home Assistant community diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 4ccc6f1..003d860 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,55 +1,52 @@ name: ✨ Feature request - description: Suggest a new feature or enhancement. - labels: ["feat"] - body: - - type: markdown - attributes: - value: | - Got an idea to make Snapdash better? πŸŽ‰ - Please describe the **problem** first, then the **solution** you have in mind. +description: Suggest a new feature or enhancement. +labels: ["feat"] +body: + - type: markdown + attributes: + value: | + Got an idea to make Snapdash better? πŸŽ‰ + Please describe the **problem** first, then the **solution** you have in mind. - - type: textarea - id: problem - attributes: - label: What problem does this solve? - description: What's missing or frustrating today? - placeholder: "I can't currently ..." - validations: - required: true + - type: textarea + id: problem + attributes: + label: What problem does this solve? + description: What's missing or frustrating today? + placeholder: "I can't currently ..." + validations: + required: true - - type: textarea - id: proposal - attributes: - label: Proposed solution - description: Ideal behavior, UI mockup, API sketch β€” anything that helps - explain. - validations: - required: true + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: Ideal behavior, UI mockup, API sketch β€” anything that helps explain. + validations: + required: true - - type: textarea - id: alternatives - attributes: - label: Alternatives considered - description: Any other approaches you considered and why they wouldn't work as - well. + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: Any other approaches you considered and why they wouldn't work as well. - - type: dropdown - id: area - attributes: - label: Which area does this affect? - options: - - UI / widgets - - Home Assistant integration - - Plugin system (future) - - Configuration / settings - - Packaging / release - - Other / cross-cutting - validations: - required: true - - - type: textarea - id: extra - attributes: - label: Additional context - description: Related issues, screenshots, references to similar tools, etc. + - type: dropdown + id: area + attributes: + label: Which area does this affect? + options: + - UI / widgets + - Home Assistant integration + - Plugin system (future) + - Configuration / settings + - Packaging / release + - Other / cross-cutting + validations: + required: true + - type: textarea + id: extra + attributes: + label: Additional context + description: Related issues, screenshots, references to similar tools, etc. diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index abfc290..026232f 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -1,24 +1,23 @@ - name: ❓ Question - description: Ask how to do something. (Usually Discussions is a better place!) - labels: ["needs-info"] - body: - - type: markdown - attributes: - value: | - πŸ’‘ **For most questions, please use [Discussions](https://github.com/schizza/snapdash/discussions) instead.** - Use Issues only if your question might turn out to be a bug or a missing feature. +description: Ask how to do something. (Usually Discussions is a better place!) +labels: ["needs-info"] +body: + - type: markdown + attributes: + value: | + πŸ’‘ **For most questions, please use [Discussions](https://github.com/schizza/snapdash/discussions) instead.** + Use Issues only if your question might turn out to be a bug or a missing feature. - - type: textarea - id: question - attributes: - label: Your question - placeholder: "I'm trying to ... but I can't figure out ..." - validations: - required: true + - type: textarea + id: question + attributes: + label: Your question + placeholder: "I'm trying to ... but I can't figure out ..." + validations: + required: true - - type: textarea - id: context - attributes: - label: Context - description: What have you tried? What docs did you consult? + - type: textarea + id: context + attributes: + label: Context + description: What have you tried? What docs did you consult? diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 59ba462..c930ffa 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,94 +1,92 @@ -name-template: 'v$RESOLVED_VERSION' - tag-template: 'v$RESOLVED_VERSION' +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" - filter-by-commitish: false +filter-by-commitish: false - version-resolver: - major: - labels: ['breaking-change', 'semver:major'] - minor: - labels: ['feat', 'feature', 'enhancement', 'semver:minor'] - patch: - labels: ['fix', 'bug', 'chore', 'refactor', 'semver:patch'] - default: patch +version-resolver: + major: + labels: ["breaking-change", "semver:major"] + minor: + labels: ["feat", "feature", "enhancement", "semver:minor"] + patch: + labels: ["fix", "bug", "chore", "refactor", "semver:patch"] + default: patch - categories: - - title: 'πŸ’₯ Breaking changes' - labels: ['breaking-change', 'semver:major'] - - title: '✨ New features' - labels: ['feat', 'feature', 'enhancement'] - - title: 'πŸ› Bug fixes' - labels: ['fix', 'bug'] - - title: '⚑ Performance' - labels: ['perf'] - - title: '🎨 UI changes' - labels: ['ui'] - - title: '🧹 Refactoring / maintenance' - labels: ['refactor', 'chore', 'maintenance'] - - title: 'πŸ“ Documentation' - labels: ['docs', 'documentation'] - - title: 'πŸ§ͺ Tests' - labels: ['test', 'tests'] - - title: 'πŸ“¦ Packaging & Release' - labels: ['packaging'] +categories: + - title: "πŸ’₯ Breaking changes" + labels: ["breaking-change", "semver:major"] + - title: "✨ New features" + labels: ["feat", "feature", "enhancement"] + - title: "πŸ› Bug fixes" + labels: ["fix", "bug"] + - title: "⚑ Performance" + labels: ["perf"] + - title: "🎨 UI changes" + labels: ["ui"] + - title: "🧹 Refactoring / maintenance" + labels: ["refactor", "chore", "maintenance"] + - title: "πŸ“ Documentation" + labels: ["docs", "documentation"] + - title: "πŸ§ͺ Tests" + labels: ["test", "tests"] + - title: "πŸ“¦ Packaging & Release" + labels: ["packaging"] - autolabeler: - - label: "feat" - branch: - - "/^feat\\//" - - "/^feature\\//" - title: - - "/^feat(\\(.+\\))?:/i" - - label: "fix" - branch: ["/^fix\\//", "/^bug\\//"] - title: ["/^fix(\\(.+\\))?:/i"] - - label: "chore" - branch: ["/^chore\\//"] - title: ["/^chore(\\(.+\\))?:/i"] - - label: "docs" - branch: ["/^docs\\//"] - title: ["/^docs(\\(.+\\))?:/i"] - - label: "refactor" - branch: ["/^refactor\\//"] - title: ["/^refactor(\\(.+\\))?:/i"] - - label: "perf" - branch: ["/^perf\\//"] - title: ["/^perf(\\(.+\\))?:/i"] - - label: "test" - branch: ["/^test\\//"] - title: ["/^test(\\(.+\\))?:/i"] - - label: "breaking-change" - title: ["/!:/"] +autolabeler: + - label: "feat" + branch: + - "/^feat\\//" + - "/^feature\\//" + title: + - "/^feat(\\(.+\\))?:/i" + - label: "fix" + branch: ["/^fix\\//", "/^bug\\//"] + title: ["/^fix(\\(.+\\))?:/i"] + - label: "chore" + branch: ["/^chore\\//"] + title: ["/^chore(\\(.+\\))?:/i"] + - label: "docs" + branch: ["/^docs\\//"] + title: ["/^docs(\\(.+\\))?:/i"] + - label: "refactor" + branch: ["/^refactor\\//"] + title: ["/^refactor(\\(.+\\))?:/i"] + - label: "perf" + branch: ["/^perf\\//"] + title: ["/^perf(\\(.+\\))?:/i"] + - label: "test" + branch: ["/^test\\//"] + title: ["/^test(\\(.+\\))?:/i"] + - label: "breaking-change" + title: ["/!:/"] - exclude-labels: - - 'skip-changelog' +exclude-labels: + - "skip-changelog" - change-template: | - - $TITLE (#$NUMBER) @$AUTHOR - $BODY +change-template: | + - $TITLE (#$NUMBER) @$AUTHOR + $BODY - change-title-escapes: '\<*_&' +change-title-escapes: '\<*_&' - replacers: - - search: "/^(feat|fix|chore|docs|refactor|perf|test|bug|enhancement|enhance)(\\(.+ - \\))?:\\s*/i" - replace: "" +replacers: + - search: "/^(feat|fix|chore|docs|refactor|perf|test|bug|enhancement|enhance)(\\(.+\\))?:\\s*/i" + replace: "" - template: | - ## What's changed in Snapdash v$RESOLVED_VERSION +template: | + ## What's changed in Snapdash v$RESOLVED_VERSION - $CHANGES + $CHANGES - --- + --- - **Full Changelog**: + **Full Changelog**: https://github.com/schizza/snapdash/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION - ### πŸ“₯ Download + ### πŸ“₯ Download - - **macOS** (Apple Silicon): `snapdash-$RESOLVED_VERSION-macos-aarch64.dmg` - - **macOS** (Intel): `snapdash-$RESOLVED_VERSION-macos-x86_64.dmg` - - **Windows**: `snapdash-$RESOLVED_VERSION-windows-x86_64.exe` - - **Linux**: `snapdash-$RESOLVED_VERSION-linux-x86_64.tar.gz` + - **macOS** (Apple Silicon): `snapdash-v$RESOLVED_VERSION-macos-aarch64.tar.gz` + - **Windows**: `snapdash-v$RESOLVED_VERSION-windows-x86_64.zip` + - **Linux**: `snapdash-v$RESOLVED_VERSION-linux-x86_64.tar.gz` - See [Installation guide](https://github.com/schizza/snapdash#installation) for details. + See [Installation guide](https://github.com/schizza/snapdash#installation) for details. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0662e0b..440fdea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 @@ -55,10 +58,8 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu - - os: macos-14 # Apple Silicon + - os: macos-14 # Apple Silicon target: aarch64-apple-darwin - - os: macos-13 # Intel - target: x86_64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65cc853..ddf43c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: types: [published] permissions: - contents: write # needed to upload release assets + contents: write # needed to upload release assets env: CARGO_TERM_COLOR: always @@ -27,11 +27,6 @@ jobs: artifact_name: snapdash asset_name: snapdash-${{ github.event.release.tag_name }}-macos-aarch64.tar.gz archive_cmd: tar -czf - - os: macos-13 - target: x86_64-apple-darwin - artifact_name: snapdash - asset_name: snapdash-${{ github.event.release.tag_name }}-macos-x86_64.tar.gz - archive_cmd: tar -czf - os: windows-latest target: x86_64-pc-windows-msvc artifact_name: snapdash.exe diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index a647cbb..af6f000 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -3,13 +3,14 @@ name: Sync Labels on: push: branches: [main, dev] - path: - - '.github/labels.yml' - - '.github/workflows/sync-labels.yml' - workflow_dispatch: + paths: + - ".github/labels.yml" + - ".github/workflows/sync-labels.yml" + workflow_dispatch: permissions: issues: write + contents: read jobs: sync: @@ -21,4 +22,4 @@ jobs: config-file: .github/labels.yml delete-other-labels: true dry-run: false - token: ${{Β secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index c19329d..7f480e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_core", "iced_debug", @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "bitflags 2.10.0", "bytes", @@ -1517,7 +1517,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_core", "iced_futures", @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "futures", "iced_core", @@ -1541,7 +1541,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "bitflags 2.10.0", "bytemuck", @@ -1559,7 +1559,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_graphics", "iced_runtime", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "bytes", "iced_core", @@ -1592,7 +1592,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "bytemuck", "cosmic-text", @@ -1608,7 +1608,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "bitflags 2.10.0", "bytemuck", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_renderer", "log", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p1#4720127476bf314e0172831d3f5c894e33d14c6f" +source = "git+https://github.com/schizza/iced.git?tag=snapdash-v0.14.0-p3#d72e8bfe99170a2487883c66adeb193055412e61" dependencies = [ "iced_debug", "iced_program", diff --git a/Cargo.toml b/Cargo.toml index 31a3204..fbd3ed8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,13 +62,13 @@ url = "2.5.7" objc2-quartz-core = "0.3.2" [patch.crates-io] -iced = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_winit = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_runtime = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_program = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_renderer = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_widget = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } -iced_core = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p1" } +iced = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_winit = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_runtime = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_program = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_renderer = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_widget = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } +iced_core = { git = "https://github.com/schizza/iced.git", tag = "snapdash-v0.14.0-p3" } # iced_winit = { path = "vendor/iced/winit" } # iced_runtime = { path = "vendor/iced/runtime" } diff --git a/src/app.rs b/src/app.rs index 0864b8a..a038f10 100644 --- a/src/app.rs +++ b/src/app.rs @@ -4,7 +4,7 @@ use crate::logger::LogType; use std::collections::{HashMap, HashSet, VecDeque}; use std::time::{Duration, Instant}; -use iced::{Element, Task, event}; +use iced::{Element, Task}; use iced::{Subscription, window}; use crate::config::Config; @@ -126,7 +126,6 @@ pub enum Message { ConnectHa, HaEvent(HaEvent), HaUrlChanged(String), - HaTokenChanged(String), HaTokenDelete, // UI events @@ -137,7 +136,6 @@ pub enum Message { SavePressed, Saved, HaTokenDraftChanged(String), - ClearStatus, WindowRedraw(window::Id, Instant), ConfigLoad(Result), StartDrag(window::Id), @@ -402,7 +400,6 @@ impl Snapdash { HaEvent::StateChanged { new_state } => { self.apply_entity_state(new_state); } - HaEvent::Other => {} } } @@ -594,10 +591,10 @@ impl Snapdash { } Message::WindowClosed(id) => { - if let Some(window) = self.windows.remove(&id) { - if let WindowKind::Entity { entity_id } = window.kind { - self.entity_windows.remove(&entity_id); - } + if let Some(window) = self.windows.remove(&id) + && let WindowKind::Entity { entity_id } = window.kind + { + self.entity_windows.remove(&entity_id); } if self.windows.is_empty() { @@ -611,12 +608,11 @@ impl Snapdash { self.config.ha_url = val; Task::none() } - Message::HaTokenChanged(_val) => Task::none(), Message::SavePressed => { self.set_status("Saving...", LogType::DoNotLog); if !self.ha_token_draft.trim().is_empty() { - match crate::secrets::set_ha_token(&self.ha_token_draft.trim()) { + match crate::secrets::set_ha_token(self.ha_token_draft.trim()) { Ok(()) => { self.config.ha_token_present = true; self.ha_token_draft.clear(); @@ -637,11 +633,6 @@ impl Snapdash { Task::perform(async {}, |_| Message::ConnectHa) } - Message::ClearStatus => { - // self.status.clear(); - Task::none() - } - Message::OpenSettings => { // if Settings window is opened, give focus // @@ -662,7 +653,7 @@ impl Snapdash { }; let (_id, task_id) = window::open(settings); - task_id.map(|actual_id| Message::WindowActuallyOpened(actual_id)) + task_id.map(Message::WindowActuallyOpened) } Message::OpenEntity(entity_id) => { @@ -696,9 +687,7 @@ impl Snapdash { .push_back(WindowKind::Entity { entity_id: widget }); let (_id, task_id) = window::open(win_settings.clone()); - task.push( - task_id.map(move |actual_id| Message::WindowActuallyOpened(actual_id)), - ); + task.push(task_id.map(Message::WindowActuallyOpened)); } if task.is_empty() { diff --git a/src/ha/types.rs b/src/ha/types.rs index 66677c1..d54ca48 100644 --- a/src/ha/types.rs +++ b/src/ha/types.rs @@ -22,7 +22,6 @@ pub enum HaEvent { Disconnected(String), InitialState(Vec), StateChanged { new_state: EntityState }, - Other, } #[derive(Clone, Debug, PartialEq, Eq, Hash)] diff --git a/src/ha/ws.rs b/src/ha/ws.rs index ce201e0..c0ea4cd 100644 --- a/src/ha/ws.rs +++ b/src/ha/ws.rs @@ -15,15 +15,6 @@ struct Incoming { #[serde(default)] event: Option, - - #[serde(default)] - success: Option, - - #[serde(default)] - result: Option, - - #[serde(default)] - message: Option, } #[derive(Debug, serde::Deserialize)] @@ -148,19 +139,14 @@ pub fn connect(config: &HaConnectionConfig) -> iced::futures::stream::BoxStream< let Ok(msg) = msg else { continue }; let Ok(text) = msg.to_text() else { continue }; - if let Ok(parsed) = serde_json::from_str::(text) { - if parsed.r#type == "event" { - if let Some(ev) = parsed.event { - if ev.event_type == "state_changed" { - if let Some(data) = ev.data { - if let Some(new_state) = data.new_state { - let _ = - output.send(HaEvent::StateChanged { new_state }).await; - } - } - } - } - } + if let Ok(parsed) = serde_json::from_str::(text) + && parsed.r#type == "event" + && let Some(ev) = parsed.event + && ev.event_type == "state_changed" + && let Some(data) = ev.data + && let Some(new_state) = data.new_state + { + let _ = output.send(HaEvent::StateChanged { new_state }).await; } } diff --git a/src/ui/chrome.rs b/src/ui/chrome.rs index eb8ac1a..eac0618 100644 --- a/src/ui/chrome.rs +++ b/src/ui/chrome.rs @@ -65,7 +65,6 @@ pub fn with_debug_overlay<'a>( if !app.config.debug_overlay { return inner; } - let p = app.theme.palette(); let last_delta = win .debug @@ -152,8 +151,7 @@ pub fn with_mouse_area<'a>( .on_exit(Message::EntityHover { window: id, on: false, - }) - .into(); + }); match win.kind { WindowKind::Entity { .. } => ma.on_press(Message::StartDrag(id)).into(), diff --git a/src/ui/components.rs b/src/ui/components.rs index c39734a..58c48b5 100644 --- a/src/ui/components.rs +++ b/src/ui/components.rs @@ -1,7 +1,6 @@ use iced::overlay::menu; use iced::widget::{ - TextInput, button, checkbox, column, container, pick_list, row, scrollable, stack, text, - text_input, + button, checkbox, column, container, pick_list, row, scrollable, stack, text, text_input, }; use iced::{Background, Border, Element, Length}; @@ -254,17 +253,17 @@ pub fn section(label: &'static str, p: Palette) -> text::Text<'static> { } // Left here intentionaly, usage in future? -pub fn label>(label: S, p: Palette) -> text::Text<'static> { - text(label.into()).color(p.text_secondary).size(14) -} +// pub fn label>(label: S, p: Palette) -> text::Text<'static> { +// text(label.into()).color(p.text_secondary).size(14) +// } pub fn dimmed>(label: S, p: Palette) -> text::Text<'static> { text(label.into()).color(p.text_dim).size(10) } -pub fn logbox>(label: S, p: Palette) -> TextInput<'static, Message> { - text_input("Empty", &label.into()).size(10).into() -} +// pub fn logbox>(label: S, p: Palette) -> TextInput<'static, Message> { +// text_input("Empty", &label.into()).size(10).into() +// } pub fn card_with_border( content: Element, @@ -290,26 +289,26 @@ pub fn card_with_border( .into() } -pub fn card_plain( - content: Element, - p: Palette, - border_color: iced::Color, -) -> Element { - iced::widget::container(content) - .padding(16) - .style(move |_| iced::widget::container::Style { - background: Some(iced::Background::Color(p.card)), // bΓ­lΓ‘ - border: iced::Border { - radius: crate::theme::metric::RADIUS.into(), - width: 0.0, - color: iced::Color::TRANSPARENT, - }, - shadow: p.shadow, // klidnΔ› nech / nebo dej menΕ‘Γ­ - ..Default::default() - }) - .into() -} - +// pub fn card_plain( +// content: Element, +// p: Palette, +// border_color: iced::Color, +// ) -> Element { +// iced::widget::container(content) +// .padding(16) +// .style(move |_| iced::widget::container::Style { +// background: Some(iced::Background::Color(p.card)), // bΓ­lΓ‘ +// border: iced::Border { +// radius: crate::theme::metric::RADIUS.into(), +// width: 0.0, +// color: iced::Color::TRANSPARENT, +// }, +// shadow: p.shadow, // klidnΔ› nech / nebo dej menΕ‘Γ­ +// ..Default::default() +// }) +// .into() +// } +// pub fn status_dot(p: Palette, ok: bool) -> Element<'static, Message> { let color = if ok { p.success } else { p.danger }; diff --git a/src/ui/entity_window.rs b/src/ui/entity_window.rs index bf5b344..21c1650 100644 --- a/src/ui/entity_window.rs +++ b/src/ui/entity_window.rs @@ -45,7 +45,7 @@ fn status_line(p: Palette, connected: bool) -> Element<'static, Message> { } fn pulse_border(p: Palette, pulse: f32) -> iced::Color { - let t = pulse.max(0.0).min(1.0); + let t = pulse.clamp(0.0, 1.0); let a = 0.10 + 0.55 * t; From f32fbe349b0be3ad4bb9553dd3a34a50ccbe021b Mon Sep 17 00:00:00 2001 From: Lukas Svoboda Date: Wed, 15 Apr 2026 14:24:00 +0200 Subject: [PATCH 2/8] fix(ci): labels root array fix (#10) --- .github/labels.yml | 214 ++++++++++++++++++++++----------------------- 1 file changed, 106 insertions(+), 108 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index c100df5..9f3b23d 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,114 +1,112 @@ -labels: - # πŸ“¦ Change type - - name: feat - color: "1abc9c" - description: "New feature or enhancement" - - name: fix - color: "e74c3c" - description: "Bug fix" - - name: docs - color: "3498db" - description: "Documentation, README, examples" - - name: refactor - color: "9b59b6" - description: "Code cleanup without behavior change" - - name: perf - color: "16a085" - description: "Performance improvement" - - name: test - color: "f39c12" - description: "Tests, mocking, coverage" - - name: chore - color: "95a5a6" - description: "Maintenance (CI/CD, dependencies, tooling)" +# πŸ“¦ Change type +- name: feat + color: "1abc9c" + description: "New feature or enhancement" +- name: fix + color: "e74c3c" + description: "Bug fix" +- name: docs + color: "3498db" + description: "Documentation, README, examples" +- name: refactor + color: "9b59b6" + description: "Code cleanup without behavior change" +- name: perf + color: "16a085" + description: "Performance improvement" +- name: test + color: "f39c12" + description: "Tests, mocking, coverage" +- name: chore + color: "95a5a6" + description: "Maintenance (CI/CD, dependencies, tooling)" - # πŸ§ͺ Status - - name: wip - color: "f1c40f" - description: "Work in progress β€” not ready to merge" - - name: blocked - color: "34495e" - description: "Blocked (waiting on review, upstream, dependency)" - - name: ready - color: "2ecc71" - description: "Ready for review / merge" - - name: needs-info - color: "e67e22" - description: "Waiting for more info from author / user" - - name: duplicate - color: "cccccc" - description: "Duplicate of another issue / PR" - - name: wontfix - color: "ffffff" - description: "Will not be worked on" +# πŸ§ͺ Status +- name: wip + color: "f1c40f" + description: "Work in progress β€” not ready to merge" +- name: blocked + color: "34495e" + description: "Blocked (waiting on review, upstream, dependency)" +- name: ready + color: "2ecc71" + description: "Ready for review / merge" +- name: needs-info + color: "e67e22" + description: "Waiting for more info from author / user" +- name: duplicate + color: "cccccc" + description: "Duplicate of another issue / PR" +- name: wontfix + color: "ffffff" + description: "Will not be worked on" - # πŸ›  Priority - - name: "priority: high" - color: "c0392b" - description: "Critical bug / release blocker" - - name: "priority: medium" - color: "d35400" - description: "Important but not urgent" - - name: "priority: low" - color: "7f8c8d" - description: "Nice-to-have / later" +# πŸ›  Priority +- name: "priority: high" + color: "c0392b" + description: "Critical bug / release blocker" +- name: "priority: medium" + color: "d35400" + description: "Important but not urgent" +- name: "priority: low" + color: "7f8c8d" + description: "Nice-to-have / later" - # πŸ’₯ Semver signals (used by release-drafter) - - name: breaking-change - color: "b60205" - description: "Changes existing public behavior β€” major bump" - - name: "semver:major" - color: "b60205" - description: "Explicit major bump signal" - - name: "semver:minor" - color: "fbca04" - description: "Explicit minor bump signal" - - name: "semver:patch" - color: "0e8a16" - description: "Explicit patch bump signal" - - name: skip-changelog - color: "bdbdbd" - description: "Omit this PR from release notes" +# πŸ’₯ Semver signals (used by release-drafter) +- name: breaking-change + color: "b60205" + description: "Changes existing public behavior β€” major bump" +- name: "semver:major" + color: "b60205" + description: "Explicit major bump signal" +- name: "semver:minor" + color: "fbca04" + description: "Explicit minor bump signal" +- name: "semver:patch" + color: "0e8a16" + description: "Explicit patch bump signal" +- name: skip-changelog + color: "bdbdbd" + description: "Omit this PR from release notes" - # 🧩 Domains (Snapdash-specific) - - name: ui - color: "c2e0c6" - description: "UI / widgets / theme / layout" - - name: core - color: "5319e7" - description: "App core (state, subscriptions, message flow)" - - name: ha-integration - color: "1d76db" - description: "Home Assistant connector (WebSocket, REST)" - - name: plugin-system - color: "8e44ad" - description: "Future pluggable data-source API" - - name: config - color: "0052cc" - description: "Configuration / persistence / secrets" - - name: packaging - color: "006b75" - description: "Build, release, bundles, installers" +# 🧩 Domains (Snapdash-specific) +- name: ui + color: "c2e0c6" + description: "UI / widgets / theme / layout" +- name: core + color: "5319e7" + description: "App core (state, subscriptions, message flow)" +- name: ha-integration + color: "1d76db" + description: "Home Assistant connector (WebSocket, REST)" +- name: plugin-system + color: "8e44ad" + description: "Future pluggable data-source API" +- name: config + color: "0052cc" + description: "Configuration / persistence / secrets" +- name: packaging + color: "006b75" + description: "Build, release, bundles, installers" - # πŸ’» Platform - - name: "platform: macOS" - color: "bfdadc" - description: "macOS-specific" - - name: "platform: Windows" - color: "bfd4f2" - description: "Windows-specific" - - name: "platform: Linux" - color: "d4c5f9" - description: "Linux-specific" - - # πŸ†• Community - - name: good-first-issue - color: "7057ff" - description: "Good entry point for new contributors" - - name: help-wanted - color: "008672" - description: "Extra attention / contribution invited" - - name: discussion - color: "d876e3" - description: "Design decision needed before work starts" +# πŸ’» Platform +- name: "platform: macOS" + color: "bfdadc" + description: "macOS-specific" +- name: "platform: Windows" + color: "bfd4f2" + description: "Windows-specific" +- name: "platform: Linux" + color: "d4c5f9" + description: "Linux-specific" +# πŸ†• Community +- name: good-first-issue + color: "7057ff" + description: "Good entry point for new contributors" +- name: help-wanted + color: "008672" + description: "Extra attention / contribution invited" +- name: discussion + color: "d876e3" + description: "Design decision needed before work starts" From 402572e10ac3eabc2b5a502231bc29b82ff74a6a Mon Sep 17 00:00:00 2001 From: Lukas Svoboda Date: Wed, 15 Apr 2026 18:10:02 +0200 Subject: [PATCH 3/8] Update discussion URL in issue template config --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index bfc2640..ba6b015 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: Q&A / General discussion - url: https://github.com/schizza/snapdash/discussion + url: https://github.com/schizza/snapdash/discussions about: Questions about usage, configuration tips, ideas - Issues are for bugs and feature requests only. - name: Snapdash website url: https://snapdash.schizza.cz From fd66a7b70c2498ad3cdb67c8887a824fe9e7e670 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:12:27 +0200 Subject: [PATCH 4/8] Bump lru from 0.16.2 to 0.16.4 (#9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f480e3..7aa9c67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1978,9 +1978,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "lru" -version = "0.16.2" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" [[package]] name = "lru-slab" From bf08d13aaa81aa564ee8550307e43cbe54d417f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:12:49 +0200 Subject: [PATCH 5/8] Bump bytes from 1.11.0 to 1.11.1 (#5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7aa9c67..ddc57a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,9 +365,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "calloop" From 8f9e36c7e3b8b5f351317020db1d8f03e4a762bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:13:01 +0200 Subject: [PATCH 6/8] Bump quinn-proto from 0.11.13 to 0.11.14 (#6) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ddc57a3..ad9a8f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2882,9 +2882,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.13" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ "bytes", "getrandom 0.3.4", From 99fcbe17aebaf8ad5596402020b26b45763cb806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:13:15 +0200 Subject: [PATCH 7/8] Bump rustls-webpki from 0.103.8 to 0.103.12 (#7) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad9a8f6..9dc6073 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3151,9 +3151,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" dependencies = [ "ring", "rustls-pki-types", From b87e5f02a271fdef48264a7ae0f60d195059875d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:13:40 +0200 Subject: [PATCH 8/8] Bump rand from 0.9.2 to 0.9.4 (#8) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dc6073..4e4cb8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2932,9 +2932,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha", "rand_core",