diff --git a/.changes/themes/fix-bedroom-click-areas-and-card-4b9e2d71.md b/.changes/themes/fix-bedroom-click-areas-and-card-4b9e2d71.md new file mode 100644 index 00000000000..7d391f709b0 --- /dev/null +++ b/.changes/themes/fix-bedroom-click-areas-and-card-4b9e2d71.md @@ -0,0 +1,8 @@ +--- +bump: patch +--- + +### Fixed + +- A click on the console's right edge also started the tape, and a click where the lava lamp meets the wall light flipped both. The console, the tape's spine and the lava lamp now take clicks over slightly narrower areas, so every click flips one thing. +- While another plugin's theme covered the room, the settings card still said `theme: on` and its theme button cleared that theme instead of bringing the room back. The card now says `theme: covered` and its button puts the room back; `/bedroom on` does the same, and `/bedroom status` says which plugin's theme covers the room. diff --git a/plugins/themes/README.md b/plugins/themes/README.md index 50dc1e0d408..444f322c20e 100644 --- a/plugins/themes/README.md +++ b/plugins/themes/README.md @@ -146,7 +146,8 @@ Changing the time or the weather by command shows within a few seconds and eases ### The settings card `/bedroom` alone shows a card in the conversation, so you need not know the words. It is six rows -whatever is open, so it fits without scrolling: the theme on or off, reset, calibrate, titles and +whatever is open, so it fits without scrolling: the theme on, off or covered (another plugin's +theme stands over the room; a press puts the room back), reset, calibrate, titles and Close; a button for each switch showing whether it is on, then `pass` (someone passes the door), `door` (the hall light's switch, checked while the light is on; the next press turns it off) and `bolt` (a lightning strike), each dim while its command would only say why not, the hallway off or @@ -176,7 +177,7 @@ clicks are answered at once. A click in those seven seconds still counts and is | Command | Does | |---|---| | `/bedroom` | Says what is on and off; in the desktop app, also shows the settings card | -| `/bedroom status` | Says what is on and off | +| `/bedroom status` | Says what is on and off, and whose theme covers the room, if another plugin's does | | `/bedroom [on\|off]` | Switches one thing; with neither word it flips. A switch already in that state stays as it is | | `/bedroom time ` | Follows the clock, or holds a phase (`HH:MM` holds the phase of that hour); alone, says which | | `/bedroom date ` | Follows the real date, or holds a day of the year for sunrise and sunset (the seasons hold 04-20, 07-15, 10-15, 01-15); alone, says which | @@ -199,7 +200,7 @@ clicks are answered at once. A click in those seven seconds still counts and is | `/bedroom stats` | Render counts and timings | | `/bedroom calibrate` | Fits clicks to your window's shape | | `/bedroom reset` | Every switch, dim, glass and blur back to its default, and time, weather, lightning, signal, hallway and sound back to the plugin's settings; titles, calibration, volume and the bank's choices stay | -| `/bedroom on`, `/bedroom off` | Sets or clears the theme | +| `/bedroom on`, `/bedroom off` | Sets or clears the theme; `on` also puts the room back over another plugin's theme | For diagnosis, `/bedroom shader off` (or `instant off`) shows the hand-drawn room alone for the rest of the session, with no fades, clock or lamp light, sending it again on every change; `/bedroom diff --git a/plugins/themes/hooks/bedroom/card.tsx b/plugins/themes/hooks/bedroom/card.tsx index 3b94d6e0352..468ba8c5146 100644 --- a/plugins/themes/hooks/bedroom/card.tsx +++ b/plugins/themes/hooks/bedroom/card.tsx @@ -5,7 +5,7 @@ import type { BedroomCard } from '../../types' import { TITLE_CAPS, describe, extraMsOf, runCommand, type TitleKey } from './core/commands.js' import { ctxOf } from './core/context.js' import { SWITCHES, type Switch } from './core/piece.js' -import { isThemeOn } from './core/render.js' +import { coveringPlugin, isThemeOn } from './core/render.js' import { volumeOf } from './core/saved.js' import { WEATHERS } from './core/settings.js' import { hallLightOn } from './pieces/hallway.js' @@ -185,7 +185,7 @@ type CardElements = Pick, 'Box' | 'Text' | 'Button' | 'I export function settingsCard($: EngineInterface, { Box, Text, Button, Input }: CardElements, now: BedroomCard) { const ctx = ctxOf($) const saved = ctx.saved - const themeLabel = isThemeOn() ? 'theme: on' : 'theme: off' + const themeLabel = coveringPlugin() !== undefined ? 'theme: covered' : isThemeOn() ? 'theme: on' : 'theme: off' const titlesLabel = now.titles === true ? 'titles: hide' : 'titles: show' const soundLabel = `sound: ${ctx.setting('sound') ? 'on' : 'off'}` const soundsLabel = now.sounds === true ? 'sounds: hide' : 'sounds: show' @@ -218,7 +218,7 @@ export function settingsCard($: EngineInterface, { Box, Text, Button, Input }: C Bedroom settings -