diff --git a/CHANGELOG.md b/CHANGELOG.md index 79c8f5e..ef4becf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ version and its date. Versions follow semantic versioning: a major version when people have to change their setup, a minor one for new skills or abilities, a patch for fixes. +## 1.1.28 - 2026-11-30 + +- `ironflock-templates`: times and dates on a board are always formatted (board-design.md, "Times and dates are always formatted"): a widget-table timestamp column has `type` `timestamp`, a `styling.timestampFormat` (`yyyy-MM-dd HH:mm` as a rule) and a width that fits it, never `type` `string`; widget-markdown uses `valueType` `timestamp` and widget-value `subTitleType` `timestamp`; transforms keep times as timestamps and leave the formatting to the widget. The board validator warns about a timestamp column without a format and about a table column that shows a timestamp column as text or a number. +- `ironflock-templates`: a widget-form that opens in a dialog (`formButton` true) gets a transparent tile background and border in `custom_style`, so its button stands on the board without an empty frame (board-interaction.md, "A form in a dialog has no frame"); the frame stays only where the user asks for one. The board validator warns about a dialog form whose tile is still framed. The example boards and the starter app follow both rules. + ## 1.1.27 - 2026-11-30 - Boards can have an AI chat: the new widget `widget-aichat` lets project members talk to one of the app's agents from `ai-template.yml`, or to the IronFlock assistant, in a tile. Boards show no assistant in view mode, so this tile is how board users talk to an agent. `ironflock-templates` lists it in the widget catalog and describes it in board-template.md ("AI chat tiles"): `agent` names the agent, `agentApp` stays empty on the app's own board, and `handle` names the columns of the conversation row that the platform writes into one of the app's tables when a conversation starts (`conversationIdColumn` required; `userColumn`, `agentColumn`, `promptColumn` and `extraColumns` optional, the extra columns' values also narrowing the tile's list of conversations). Anyone who may read the project can chat; the platform writes the row only when whoever last saved the tile may write the app's data. The row's table is a plain log without an entity key, so a chat cannot overwrite an entity's state. board-design.md and board-interaction.md say where the tile goes and what its texts say. diff --git a/VERSION b/VERSION index 93325dd..9090603 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.27 +1.1.28 diff --git a/plugins/ironflock-appliance/.claude-plugin/plugin.json b/plugins/ironflock-appliance/.claude-plugin/plugin.json index 88d6bf5..80b8a1d 100644 --- a/plugins/ironflock-appliance/.claude-plugin/plugin.json +++ b/plugins/ironflock-appliance/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ironflock-appliance", "displayName": "IronFlock Appliance", - "version": "1.1.27", + "version": "1.1.28", "description": "Add a direct connection from Claude Code to your IronFlock appliance. Configure the appliance’s HTTPS MCP address and sign in to that installation.", "author": { "name": "IronFlock", diff --git a/plugins/ironflock-dev/.claude-plugin/plugin.json b/plugins/ironflock-dev/.claude-plugin/plugin.json index 3f39146..0a4d200 100644 --- a/plugins/ironflock-dev/.claude-plugin/plugin.json +++ b/plugins/ironflock-dev/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ironflock-dev", "displayName": "IronFlock Dev", - "version": "1.1.27", + "version": "1.1.28", "description": "Build on IronFlock: design and scaffold edge apps that keep their state in the app's tables and embed their devices' web UIs in the board, write and validate their .ironflock templates (boards and widgets, data tables, app parameters, remote-access ports, AI agents), and create, change and check the board widgets themselves (@ironflock/widget-* Lit components). Needs the ironflock plugin, which Claude Code installs with it.", "author": { "name": "IronFlock", diff --git a/plugins/ironflock-dev/skills/ironflock-templates/assets/app-template/.ironflock/board-template.yml b/plugins/ironflock-dev/skills/ironflock-templates/assets/app-template/.ironflock/board-template.yml index bee47e5..3d8faef 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/assets/app-template/.ironflock/board-template.yml +++ b/plugins/ironflock-dev/skills/ironflock-templates/assets/app-template/.ironflock/board-template.yml @@ -116,6 +116,9 @@ widgets: - {column: deleted, operator: '=', value: false, dataType: boolean} - header: $str:Updated type: $str:timestamp + styling: + timestampFormat: $str:yyyy-MM-dd HH:mm + width: $str:130px values: tableRef: tablename: devices @@ -342,6 +345,9 @@ widgets: hiddenField: $bool:true defaultValueBoolean: $bool:true targetColumn: {tablename: devices, column: deleted, dataType: boolean} + custom_style: + tile_background_color: transparent + tile_border_color: transparent - layout_id: settings-form package_name: widget-form version: 2.0.1 @@ -374,6 +380,9 @@ widgets: columns: - header: $str:Saved type: $str:timestamp + styling: + timestampFormat: $str:yyyy-MM-dd HH:mm + width: $str:130px values: tableRef: tablename: settings diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/board-assets.md b/plugins/ironflock-dev/skills/ironflock-templates/references/board-assets.md index 67e3847..d472edc 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/board-assets.md +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/board-assets.md @@ -199,8 +199,9 @@ board, or offer both: `fab: $bool:false`, the label "Delete", `iconName` `delete` and a red `bgColor`, its key field filtered with `useRoute`, and `submitNavigationRoute` back to the type's page (`/machine`), so it leads - back to the list after the save. Give its tile about the size of the button - (some 12 × 5 cells; on a board people touch, `size` large with `fixedWidth` + back to the list after the save. Give its tile a transparent tile border and + background, like every form in a dialog (board-interaction.md), and about + the size of the button (some 12 × 5 cells; on a board people touch, `size` large with `fixedWidth` and `fixedHeight`, 7 rows and 14 columns for "Delete", board-interaction.md), next to the edit form, not over it. diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/board-critique.md b/plugins/ironflock-dev/skills/ironflock-templates/references/board-critique.md index ded1e8e..da616e5 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/board-critique.md +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/board-critique.md @@ -38,9 +38,12 @@ board-interaction.md. the navigation band or the tile border; chart series have the series colours of the preset; the same thing has the same shape (one gauge per machine, the same size, in the order of the machine list); the same - quantity has the same unit and precision; titles follow one pattern in one + quantity has the same unit and precision; every time and date is + formatted (a widget-table timestamp column has `type` `timestamp` and a + `styling.timestampFormat`, board-design.md); a form in a dialog sits on a + transparent tile (board-interaction.md); titles follow one pattern in one language; the style is the preset's, whole. Correct: align the colour maps, - sizes, units and titles. + sizes, units and titles, set the time formats, clear the form tiles. 5. **Accessibility.** Text and state colours are the preset's, which pass contrast (`lobby` only over a picture no lighter behind the tiles than its `background_color`); no colour written into markup that the theme cannot diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/board-design.md b/plugins/ironflock-dev/skills/ironflock-templates/references/board-design.md index 5cb2e02..b6be899 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/board-design.md +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/board-design.md @@ -106,6 +106,18 @@ States: RUNNING green, IDLE grey, FAULT red, the same on every widget. widget-value is left for two cases: a figure that is the average of its latest readings (`advanced.averageLatest`), and one readout per distinct value of a column for however many there are (`multiChart` with `pivot`). +- **Times and dates are always formatted.** Every time or date on a board + reads as a date and time in the viewer's time zone, never as a raw value + (epoch milliseconds, or ISO 8601 in UTC such as `2026-11-15T13:32:05.000Z`). + A widget-table column of a timestamp has `type: $str:timestamp`, a + `styling.timestampFormat` and a `styling.width` that fits it: `yyyy-MM-dd + HH:mm` as a rule, `dd.MM.yyyy HH:mm` on a German board, `HH:mm:ss` where all + rows fall on one day, `yyyy-MM-dd` for a date. Never show a timestamp column + as `type: $str:string`. In widget-markdown a time is a `data[]` entry with + `valueType: $str:timestamp`, and a widget-value subtitle bound to a time has + `subTitleType: $str:timestamp`. Keep times as timestamp columns in transforms + and let the widget format them: text made in SQL (`to_char`) shows the + database's time zone, not the viewer's. - **An agent to talk to is a tile.** A board shows no AI assistant in view mode. Where its users should talk to an agent, such as dictating a report at the machine, place a widget-aichat on the page of what the talk is @@ -133,7 +145,7 @@ means something: (no `fontColor`, `valueColor` or `labelColor` unless the colour is a state), tiles keep the preset's tile colour (a widget's own `custom_style` colours only where a tile must blend in: navigation widgets, and the transparent - tiles of buttons and dialog forms of board-assets.md), and decorative colours + tiles of forms in a dialog of board-interaction.md), and decorative colours are left out. On a board where everything is coloured, nothing is an alarm. The alarm red also marks an action that destroys something: the Delete button and its dialog (board-interaction.md has its red per preset). diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/board-forms.md b/plugins/ironflock-dev/skills/ironflock-templates/references/board-forms.md index 940f5c5..b506f2c 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/board-forms.md +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/board-forms.md @@ -78,6 +78,9 @@ The delete form on the record's page: hiddenField: $bool:true defaultValueBoolean: $bool:true targetColumn: {tablename: machines, column: deleted, dataType: boolean} + custom_style: # a form in a dialog has no frame + tile_background_color: transparent + tile_border_color: transparent ``` In the table variant, the same delete form has `openParameter: $str:delete` diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/board-interaction.md b/plugins/ironflock-dev/skills/ironflock-templates/references/board-interaction.md index c6fb548..733b553 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/board-interaction.md +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/board-interaction.md @@ -1,7 +1,7 @@ # Boards people act on -The words, sizes and contrast of what people click. The forms are in +The words, sizes, tiles and contrast of what people click. The forms are in board-assets.md, colours and presets in board-design.md. ## Words @@ -61,6 +61,25 @@ columns, about 9 px per character. Recount them when `grid_gap` changes. A "New" button on a list gets its own band above the list, not over its items. +## A form in a dialog has no frame + +A widget-form with `formButton: $bool:true` opens in a dialog: its tile shows +only the button, or nothing at all when it opens on `openParameter`. Give +that tile a transparent background and border in the widget's +`custom_style`, so the button stands on the board without an empty card +around it and the tile of a form that opens on a parameter is invisible: + +```yaml +custom_style: + tile_background_color: transparent + tile_border_color: transparent +``` + +This holds for every form in a dialog: the "New" button, the red Delete +button, and the edit and delete forms opened from a table. Keep the frame +only where the user asks for one. A form shown in its tile +(`formButton: $bool:false`) keeps the preset's tile, like any other card. + ## Contrast - Text needs 4.5:1 (from 24 px, or 19 px bold, 3:1), state colours, icons diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/example-board.yml b/plugins/ironflock-dev/skills/ironflock-templates/references/example-board.yml index 6e45111..84e4a18 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/example-board.yml +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/example-board.yml @@ -167,6 +167,9 @@ widgets: dataType: boolean - header: $str:Updated type: $str:timestamp + styling: + timestampFormat: $str:yyyy-MM-dd HH:mm + width: $str:130px values: tableRef: tablename: machine_status diff --git a/plugins/ironflock-dev/skills/ironflock-templates/references/example-mobile-board.yml b/plugins/ironflock-dev/skills/ironflock-templates/references/example-mobile-board.yml index 06184eb..7578bfb 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/references/example-mobile-board.yml +++ b/plugins/ironflock-dev/skills/ironflock-templates/references/example-mobile-board.yml @@ -189,6 +189,9 @@ widgets: columns: - header: $str:When type: $str:timestamp + styling: + timestampFormat: $str:yyyy-MM-dd HH:mm + width: $str:130px values: tableRef: tablename: machine_reports diff --git a/plugins/ironflock-dev/skills/ironflock-templates/scripts/board_checks.py b/plugins/ironflock-dev/skills/ironflock-templates/scripts/board_checks.py index dfa6d9b..901602c 100644 --- a/plugins/ironflock-dev/skills/ironflock-templates/scripts/board_checks.py +++ b/plugins/ironflock-dev/skills/ironflock-templates/scripts/board_checks.py @@ -628,6 +628,7 @@ def check_widget(board: Board, i: int, w: dict, offline: bool, cache: dict, plac if package == "widget-form" and isinstance(config, dict): check_form_targets(board, config, cpath) check_open_parameter(board, config, cpath) + check_dialog_form_tile(board, w, config, wpath) if package == "widget-toolbar" and isinstance(config, dict): check_toolbar_targets(board, config, cpath) if package == CHAT_WIDGET and isinstance(config, dict): @@ -635,6 +636,7 @@ def check_widget(board: Board, i: int, w: dict, offline: bool, cache: dict, plac if package == "widget-table" and isinstance(config, dict): check_single_record_table(board, config, cpath) check_edit_columns(board, config, cpath) + check_table_times(board, config, cpath) if package == "widget-markdown" and isinstance(config, dict): rendered = cache.get((package, version if isinstance(version, str) else None), (None,))[0] check_markdown(board, config, cpath, rendered or (version if isinstance(version, str) else None)) @@ -1238,6 +1240,67 @@ def check_edit_columns(board: Board, config: dict, path: list) -> None: board.params_set.setdefault(name.strip(), []).append(cpath + ["styling", "parameterKey"]) +def check_table_times(board: Board, config: dict, path: list) -> None: + """Every time on a board is formatted (board-design.md, "Times and dates are + always formatted"): a widget-table 'timestamp' column has a timestampFormat + (empty shows ISO 8601 in UTC), and a column bound to a timestamp column of a + known table is a 'timestamp' column, not text or a number.""" + columns = config.get("columns") if isinstance(config.get("columns"), list) else [] + for k, col in enumerate(columns): + if not isinstance(col, dict): + continue + cpath = path + ["columns", k] + kind = constant(col.get("type")) + styling = col.get("styling") if isinstance(col.get("styling"), dict) else {} + if kind == "timestamp": + raw = styling.get("timestampFormat") + if isinstance(raw, dict): + continue # bound: cannot be known + fmt = constant(raw) + if not isinstance(fmt, str) or not fmt.strip(): + board.warn( + cpath + ["styling"] if isinstance(col.get("styling"), dict) else cpath, + "a 'timestamp' column needs styling.timestampFormat (such as $str:yyyy-MM-dd HH:mm) and a styling.width " + "that fits it; without one it shows ISO 8601 in UTC (2026-11-15T13:32:05.000Z)", + ) + continue + if kind not in ("string", "number"): + continue + values = col.get("values") + ref = values.get("tableRef") if isinstance(values, dict) else None + if not isinstance(ref, dict) or not isinstance(ref.get("tablename"), str): + continue + fmt = ref.get("format") + column = fmt.get("value") if isinstance(fmt, dict) else fmt + known = board.columns_of(ref["tablename"], ref.get("provider_app")) + if isinstance(column, str) and known and known.get(column) == "timestamp": + board.warn( + cpath + ["type"], + f"'{column}' is a timestamp shown as {kind}: make it type: $str:timestamp with a styling.timestampFormat " + "(such as $str:yyyy-MM-dd HH:mm), so it reads as a date and time in the viewer's time zone", + ) + + +def check_dialog_form_tile(board: Board, w: dict, config: dict, wpath: list) -> None: + """A widget-form in a dialog (formButton true) shows only its button, or + nothing when it opens on openParameter; its tile gets a transparent + background and border (board-interaction.md, "A form in a dialog has no + frame").""" + if constant(config.get("formButton")) is not True: + return + style, spath = w.get("custom_style"), wpath + ["custom_style"] + if style is None and isinstance(w.get("widget_config"), dict): + style, spath = w["widget_config"].get("custom_style"), wpath + ["widget_config", "custom_style"] + style = style if isinstance(style, dict) else {} + framed = [key for key in ("tile_background_color", "tile_border_color") if str(style.get(key, "")).strip().lower() != "transparent"] + if framed: + board.warn( + spath if style else wpath, + f"a form in a dialog shows only its button on the board: set {' and '.join(framed)} to transparent in custom_style, " + "so it stands without an empty frame (keep the frame only where the user asked for one)", + ) + + def check_open_parameter(board: Board, config: dict, path: list) -> None: """A widget-form with openParameter opens its dialog while the URL carries that parameter (a widget-table 'edit' column sets it to a record's key) and diff --git a/plugins/ironflock/.claude-plugin/plugin.json b/plugins/ironflock/.claude-plugin/plugin.json index 7d039e7..973e25e 100644 --- a/plugins/ironflock/.claude-plugin/plugin.json +++ b/plugins/ironflock/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ironflock", "displayName": "IronFlock", - "version": "1.1.27", + "version": "1.1.28", "description": "Connect Claude to IronFlock in the cloud with browser sign-in. Work with devices, apps, alarms, logs and project data. Add the optional IronFlock Appliance plugin for a direct connection to a local installation.", "author": { "name": "IronFlock", diff --git a/tests/boards/times-and-dialog-tiles.yml b/tests/boards/times-and-dialog-tiles.yml new file mode 100644 index 0000000..f9d120b --- /dev/null +++ b/tests/boards/times-and-dialog-tiles.yml @@ -0,0 +1,116 @@ +# yaml-language-server: $schema=https://ironflock.com/schemas/board-template/v1.yml +# Times are formatted (board-design.md) and a form in a dialog has no frame +# (board-interaction.md). No versions are pinned: the configs are checked +# against the latest published schemas. +# The table: a timestamp column without a format, one with a format, a timestamp +# shown as text, and a text column that is no timestamp. +# expect: WARN widgets[0].chartconfig.columns[0] :: needs styling.timestampFormat +# expect-none: widgets[0].chartconfig.columns[1].styling +# expect: WARN widgets[0].chartconfig.columns[2].type :: 'tsp' is a timestamp shown as string +# expect-none: widgets[0].chartconfig.columns[3].type +# The forms: a dialog form with no custom_style, one with a transparent tile, +# one in its tile (no dialog), and one whose border is still drawn. +# expect: WARN widgets[1] :: set tile_background_color and tile_border_color to transparent +# expect-none: widgets[2] +# expect-none: widgets[2].custom_style +# expect-none: widgets[3] +# expect-none: widgets[3].custom_style +# expect: WARN widgets[4].custom_style :: set tile_border_color to transparent +name: times-and-dialog-tiles-board +widgets: + - layout_id: states + package_name: widget-table + chartconfig: + title: $str:Machine states + columns: + - header: $str:Since + type: $str:timestamp + values: + tableRef: + tablename: machine_status + format: {value: tsp} + queryParams: + limit: 50 + filterAnd: + - {latest: true, column: '', operator: '=', value: '', dataType: boolean} + - header: $str:Updated + type: $str:timestamp + values: + tableRef: + tablename: machine_status + format: {value: tsp} + queryParams: + limit: 50 + filterAnd: + - {latest: true, column: '', operator: '=', value: '', dataType: boolean} + styling: + timestampFormat: $str:yyyy-MM-dd HH:mm + width: $str:130px + - header: $str:Recorded + type: $str:string + values: + tableRef: + tablename: machine_status + format: {value: tsp} + queryParams: + limit: 50 + filterAnd: + - {latest: true, column: '', operator: '=', value: '', dataType: boolean} + - header: $str:Machine + type: $str:string + values: + tableRef: + tablename: machine_status + format: {value: machine_id} + queryParams: + limit: 50 + filterAnd: + - {latest: true, column: '', operator: '=', value: '', dataType: boolean} + - layout_id: framed-dialog + package_name: widget-form + chartconfig: + title: $str:Set target speed + formButton: $bool:true + formFields: + - label: $str:Target speed (rpm) + type: $str:numberfield + targetColumn: {tablename: machine_status, column: target_rpm, dataType: numeric} + - layout_id: clear-dialog + package_name: widget-form + chartconfig: + title: $str:Set target speed + formButton: $bool:true + formFields: + - label: $str:Target speed (rpm) + type: $str:numberfield + targetColumn: {tablename: machine_status, column: target_rpm, dataType: numeric} + custom_style: + tile_background_color: transparent + tile_border_color: transparent + - layout_id: in-tile + package_name: widget-form + chartconfig: + title: $str:Set target speed + formButton: $bool:false + formFields: + - label: $str:Target speed (rpm) + type: $str:numberfield + targetColumn: {tablename: machine_status, column: target_rpm, dataType: numeric} + - layout_id: border-left + package_name: widget-form + chartconfig: + title: $str:Set target speed + formButton: $bool:true + formFields: + - label: $str:Target speed (rpm) + type: $str:numberfield + targetColumn: {tablename: machine_status, column: target_rpm, dataType: numeric} + custom_style: + tile_background_color: transparent +layout: + gridLayout: + - {id: states, x: 0, y: 0, w: 72, h: 64} + - {id: framed-dialog, x: 72, y: 0, w: 24, h: 16} + - {id: clear-dialog, x: 72, y: 16, w: 24, h: 16} + - {id: in-tile, x: 72, y: 32, w: 24, h: 16} + - {id: border-left, x: 72, y: 48, w: 24, h: 16}