Skip to content

Release v0.0.11#80

Merged
schizza merged 5 commits into
mainfrom
dev
Jun 9, 2026
Merged

Release v0.0.11#80
schizza merged 5 commits into
mainfrom
dev

Conversation

@schizza

@schizza schizza commented Jun 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

schizza added 4 commits May 24, 2026 16:55
Set rows and inner widgets to Fill so content fills the card.
Wrap value_text in a container, use metric::GAP spacing, and
simplify inner column assembly for connected/disconnected cases.
## Summary

Adds a per-widget settings dialog for per-widget tweaks, and ships two
issue-driven features inside it: custom widget
names (#78) and conditional visibility rules (#77).


### Per-widget settings dialog
- New `WindowKind::WidgetSettings { entity_id }` — a small dedicated
window per widget, mirroring the main Settings shape (chrome + sections
+ footer with the entity_id hint).
- Opened from a **sliders icon** in the widget's top-right corner, or
from a sliders shortcut in **Settings → Sensors** so hidden widgets stay
reachable.
- Three sections wired up: **Display** (custom name), **Behavior**
(priority), **Show only when…** (visibility rule).
- Built entirely on the existing `settings_components` set —
`page_with_sections`, `section`, `item_with_picker`, `item_with_input`,
`item_with_toggle` — so it stays consistent with every other settings
page.
- Priority quick-dots on the widget stay as a shortcut; dialog and dots
write to the same `widget_priorities` map.

### Custom widget names (closes #78)
- `widget_names: HashMap<String, String>` on Config; empty value drops
the override.
- `Snapdash::display_name(entity_id)` resolves: override → HA
`friendly_name` → bare entity_id without the domain prefix. Used by both
widget title and dialog title.
- Live text input — the dialog title updates as you type.

### Conditional visibility rules (closes #77)
- New `widget_visibility` module with `VisibilityRule { trigger,
condition }` and 5 condition types: `StateEquals`, `StateNotEquals`,
`IsAvailable`, `NumericGt`, `NumericLt`. Cross-entity or
self-triggering, state-only. Numeric thresholds stored as raw `String`
so the UI can bind them directly; invalid numbers fail-closed and hide
the widget.
- `Snapdash::reconcile_visibility` re-evaluates every rule-gated widget
on `HaEvent::InitialState` / `StateChanged` and emits `OpenEntity` /
`CloseWindow` for the deltas. Widgets without a rule are left alone —
user controls those, otherwise manual close would bounce right back.
- `entity_windows_opening` race-guard set so a flurry of HA events
during the async `window::open` round-trip doesn't double-open the same
widget.
- Bulk boot-open filters by `is_widget_visible` — gated widgets wait for
the first HA snapshot. Hide-until-known by default.
- Editor section in the dialog: enable toggle, trigger entity input with
live ✓/⚠ found-in-HA hint, condition picker, value input
(variant-dependent), and a live **Currently visible/hidden** preview.
Toggle-off explicitly re-opens the widget (reconcile only iterates rules
that exist).
- **Hidden by rule** pill badge in Settings → Sensors active list so a
rule-hidden widget stays findable, with the sliders shortcut next to it
for one-click access to the dialog.

## Notable extras

- New `Icon::Sliders` glyph (lucide `sliders-horizontal`) — used by both
  the on-widget trigger and the active-sensors-list shortcut so they
  visually pair.
- `widget_visibility` ships with unit tests covering every condition
  branch + unknown-trigger / non-numeric fallthrough.
- Sensors row layout was reworked so the badge and the sliders icon
  always sit at the right edge regardless of friendly_name / entity_id
  wrapping.

## Closes

- #77 (Conditional widgets)
- #78 (Custom widget names)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 335fe1d3aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/snapdash.rs
If the last window closes but any configured widget has a visibility
rule, keep the process alive so future state changes can reopen widgets.
Preserve original exit behavior for users without rules; rule users can
quit via Settings → Quit.
@schizza schizza merged commit 0759b03 into main Jun 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant