From 2365874fb88bfe9e2d4ada8edd88e72bde83e1d6 Mon Sep 17 00:00:00 2001 From: Yudhi Armyndharis Date: Wed, 22 Jul 2026 09:24:02 +0700 Subject: [PATCH] fix(chat-flow): repair the option-row layout, dark theme, and the newline hint (1.0.7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three defects in the visual flow editor, all reproduced in a running dashboard before and after the change. The option rows were unusable. `input[type="text"]` sets width:100% and, as an element+attribute selector, has specificity (0,1,1) — which beats the bare `.node-key` class at (0,1,0). The key field therefore stretched across the whole flex row and pushed the reply textarea and the row's buttons outside the panel, clipped and unreachable, so a menu could not be edited at all. The rule is now `input.node-key` and carries its width through flex-basis, so it holds even if the stylesheet is later reordered. The greeting placeholder read "Hi! Please choose:\n1. Hosting" with a literal backslash-n, because \n in an HTML attribute is two characters, not a line break. It modelled input that the plugin sends to WhatsApp verbatim. It now uses and shows the example across real lines. The editor was light-only, so on a dark dashboard it rendered as a bright panel inside a dark dialog. Colours now come from custom properties with a dark override, driven by the theme the host reports in the config handshake (OpenWA 0.10.5+). The sandboxed iframe has an opaque origin and cannot read the parent's theme itself, so without that field it can only guess; `prefers-color-scheme` remains the fallback for an older host, which keeps this working either way. --- README.md | 2 +- chat-flow/CHANGELOG.md | 19 +++++ chat-flow/README.md | 4 +- chat-flow/config/index.html | 148 +++++++++++++++++++++++++++--------- chat-flow/manifest.json | 2 +- plugins.json | 6 +- 6 files changed, 139 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 0f4cafd..03f8cc4 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ This repository provides: | Plugin | Description | Version | Status | | ------ | ----------- | ------- | ------ | | [`after-hours`](./after-hours) | Auto-replies with a configurable away/closing message to messages received outside business hours. | 0.1.3 | stable | -| [`chat-flow`](./chat-flow) | Interactive, stateful auto-reply: a trigger word starts a greeting + numbered menu, replies traverse a configurable menu tree, and per-chat state expires after 15 minutes. | 1.0.6 | stable | +| [`chat-flow`](./chat-flow) | Interactive, stateful auto-reply: a trigger word starts a greeting + numbered menu, replies traverse a configurable menu tree, and per-chat state expires after 15 minutes. | 1.0.7 | stable | | [`chatwoot-adapter`](./chatwoot-adapter) | Two-way sync between a WhatsApp session and a Chatwoot inbox: relays WhatsApp messages (1:1 and groups, with media) into Chatwoot as an API-channel inbox, sends agent replies back to WhatsApp, and hands a chat over to a human agent — silencing other OpenWA bots — when an agent takes it in Chatwoot. First consumer of the OpenWA Integration SDK v1; runs sandboxed in the plugin worker. | 0.5.4 | beta | | [`faq-bot`](./faq-bot) | Auto-replies to inbound WhatsApp messages from configurable FAQ keyword/regex rules. | 0.1.7 | stable | | [`group-translate`](./group-translate) | Auto-translates group messages between participants' languages via a LibreTranslate backend. Configure in-chat with /tr commands. Admin-gated; disabled until enabled. | 1.0.6 | stable | diff --git a/chat-flow/CHANGELOG.md b/chat-flow/CHANGELOG.md index e21acbb..04f24b0 100644 --- a/chat-flow/CHANGELOG.md +++ b/chat-flow/CHANGELOG.md @@ -8,6 +8,25 @@ The version here always matches `manifest.json`'s `version`. ## [Unreleased] +## [1.0.7] — 2026-07-22 + +### Fixed + +- **The menu-option rows are usable again.** Each option row rendered with its key field stretched + across the full width, pushing the reply text and the row's own buttons outside the panel, where they + were cut off and unreachable — so a menu could not be edited at all. The row now lays out as intended: + a narrow key, the reply text filling the space, and the Remove and Sub-option buttons visible beside + them. +- **The greeting placeholder no longer suggests typing `\n` for a line break.** It showed + `Hi! Please choose:\n1. Hosting` literally, and a `\n` typed into the greeting is delivered to + WhatsApp exactly as written rather than as a new line. The example is now shown across real lines. + +### Added + +- **The editor follows the dashboard's dark theme.** It was always light, so on a dark dashboard it + appeared as a bright panel in the middle of the dialog. It now uses whichever theme the dashboard + reports (OpenWA 0.10.5+), and falls back to the operating system preference on older versions. + ## [1.0.6] — 2026-07-18 ### Fixed diff --git a/chat-flow/README.md b/chat-flow/README.md index 60aac64..739716a 100644 --- a/chat-flow/README.md +++ b/chat-flow/README.md @@ -13,8 +13,8 @@ | Field | Value | | ----- | ----- | | **Identifier** | `chat-flow` | -| **Version** | 1.0.6 | -| **Released** | 2026-07-18 | +| **Version** | 1.0.7 | +| **Released** | 2026-07-22 | | **Status** | stable | | **Author** | Yudhi Armyndharis | | **License** | MIT | diff --git a/chat-flow/config/index.html b/chat-flow/config/index.html index 1d7dd66..67f99f2 100644 --- a/chat-flow/config/index.html +++ b/chat-flow/config/index.html @@ -5,60 +5,127 @@ Chat Flow Config @@ -123,7 +190,7 @@

Chat Flow Editor

- +
@@ -275,10 +342,21 @@

Chat Flow Editor

feedback.style.display = 'none'; } + // The host resolves 'system' for us, so this is only ever 'light' or 'dark'. Anything else (including + // a host too old to send it) leaves the attribute off, which falls back to the OS preference. Sent once + // with the config handshake — the theme control is behind the modal overlay, so it cannot change while + // this editor is open. + function applyTheme(theme) { + if (theme === 'light' || theme === 'dark') { + document.documentElement.setAttribute('data-theme', theme); + } + } + window.addEventListener('message', function(event) { var data = event.data; if (!data || typeof data.type !== 'string') return; if (data.type === 'config:value') { + applyTheme(data.theme); populateConfig(data.config); } else if (data.type === 'config:saved') { showFeedback('Saved!', true); diff --git a/chat-flow/manifest.json b/chat-flow/manifest.json index 66ee78e..c47ef76 100644 --- a/chat-flow/manifest.json +++ b/chat-flow/manifest.json @@ -1,7 +1,7 @@ { "id": "chat-flow", "name": "Chat Flow", - "version": "1.0.6", + "version": "1.0.7", "type": "extension", "main": "dist/index.js", "description": "Interactive, stateful auto-reply: a trigger word starts a greeting + numbered menu, replies traverse a configurable menu tree, and per-chat state expires after 15 minutes.", diff --git a/plugins.json b/plugins.json index 235bf45..61744e3 100644 --- a/plugins.json +++ b/plugins.json @@ -197,7 +197,7 @@ { "id": "chat-flow", "name": "Chat Flow", - "version": "1.0.6", + "version": "1.0.7", "type": "extension", "status": "stable", "description": "Interactive, stateful auto-reply: a trigger word starts a greeting + numbered menu, replies traverse a configurable menu tree, and per-chat state expires after 15 minutes.", @@ -214,11 +214,11 @@ ], "minOpenWAVersion": "0.7.0", "testedOpenWAVersion": "0.8.1", - "releasedAt": "2026-07-18", + "releasedAt": "2026-07-22", "repoPath": "chat-flow", "repoUrl": "https://github.com/rmyndharis/OpenWA-plugins", "homepage": "https://github.com/rmyndharis/OpenWA-plugins/tree/main/chat-flow", - "download": "https://github.com/rmyndharis/OpenWA-plugins/releases/download/chat-flow-v1.0.6/chat-flow.zip", + "download": "https://github.com/rmyndharis/OpenWA-plugins/releases/download/chat-flow-v1.0.7/chat-flow.zip", "i18n": { "es": { "name": "Flujo de Chat",