qube_rails 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +321 -0
  3. data/README.md +406 -76
  4. data/app/assets/javascripts/qube_rails/question.js +469 -43
  5. data/app/assets/stylesheets/qube_rails.css +1349 -912
  6. data/app/controllers/qube_rails/connections_controller.rb +42 -9
  7. data/app/controllers/qube_rails/questions_controller.rb +39 -7
  8. data/app/controllers/qube_rails/runs_controller.rb +4 -3
  9. data/app/controllers/qube_rails/storyboard_controller.rb +1 -1
  10. data/app/models/qube_rails/connection.rb +131 -9
  11. data/app/models/qube_rails/quickbooks_record.rb +22 -0
  12. data/app/models/qube_rails/run.rb +28 -10
  13. data/app/views/qube_rails/_error.html.erb +2 -2
  14. data/app/views/qube_rails/_manage_connection.html.erb +19 -0
  15. data/app/views/qube_rails/_question.html.erb +4 -1
  16. data/app/views/qube_rails/question/_choice.html.erb +34 -11
  17. data/app/views/qube_rails/question/_disclosure.html.erb +7 -0
  18. data/app/views/qube_rails/question/_exit_button.html.erb +8 -0
  19. data/app/views/qube_rails/question/_field.html.erb +4 -3
  20. data/app/views/qube_rails/question/_footer.html.erb +12 -4
  21. data/app/views/qube_rails/question/_inline_search.html.erb +12 -0
  22. data/app/views/qube_rails/question/_pick.html.erb +29 -6
  23. data/app/views/qube_rails/question/_picks.html.erb +2 -1
  24. data/app/views/qube_rails/question/_question.html.erb +31 -7
  25. data/app/views/qube_rails/question/_submit.html.erb +9 -0
  26. data/app/views/qube_rails/question/fields/_boolean.html.erb +2 -2
  27. data/app/views/qube_rails/question/fields/_number.html.erb +2 -2
  28. data/app/views/qube_rails/question/fields/_rows.html.erb +17 -4
  29. data/app/views/qube_rails/question/fields/_search.html.erb +6 -3
  30. data/app/views/qube_rails/question/fields/_select.html.erb +6 -5
  31. data/app/views/qube_rails/question/fields/_text.html.erb +2 -2
  32. data/app/views/qube_rails/question/rows/_segmented.html.erb +3 -1
  33. data/app/views/qube_rails/run_status/_detail.html.erb +5 -1
  34. data/app/views/qube_rails/run_status/_status.html.erb +5 -2
  35. data/app/views/qube_rails/storyboard/show.html.erb +4 -3
  36. data/config/locales/en.yml +30 -1
  37. data/config/routes.rb +2 -0
  38. data/db/migrate/20261031000000_add_qube_connection_type_and_run_headline.rb +12 -0
  39. data/db/migrate/20261124000000_add_qube_company_file_change.rb +17 -0
  40. data/lib/generators/qube_rails/templates/connection_events.rb.tt +17 -1
  41. data/lib/generators/qube_rails/templates/initializer.rb.tt +12 -4
  42. data/lib/qube_rails/configuration.rb +5 -2
  43. data/lib/qube_rails/connection_events.rb +70 -7
  44. data/lib/qube_rails/engine.rb +1 -0
  45. data/lib/qube_rails/link_check.rb +274 -0
  46. data/lib/qube_rails/operation.rb +116 -32
  47. data/lib/qube_rails/question_view.rb +293 -35
  48. data/lib/qube_rails/request.rb +2 -0
  49. data/lib/qube_rails/rows_view.rb +18 -5
  50. data/lib/qube_rails/run_status_view.rb +12 -7
  51. data/lib/qube_rails/storyboard/ask_about_add.json +9 -11
  52. data/lib/qube_rails/storyboard/choose.json +10 -7
  53. data/lib/qube_rails/storyboard/enum_select.json +5 -4
  54. data/lib/qube_rails/storyboard/missing_record.json +11 -14
  55. data/lib/qube_rails/storyboard/name_clash.json +51 -21
  56. data/lib/qube_rails/storyboard/near_match.json +18 -15
  57. data/lib/qube_rails/storyboard/number_boolean.json +5 -4
  58. data/lib/qube_rails/storyboard/record_search.json +15 -16
  59. data/lib/qube_rails/storyboard/refusal.json +15 -18
  60. data/lib/qube_rails/storyboard/rows.json +45 -31
  61. data/lib/qube_rails/storyboard.rb +28 -7
  62. data/lib/qube_rails/sync_status.rb +16 -3
  63. data/lib/qube_rails/version.rb +1 -1
  64. data/lib/qube_rails/view_helpers.rb +4 -2
  65. data/lib/qube_rails.rb +11 -2
  66. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: deb2eb2f7213591f12c48f2ecbf23e1eece273630d9b716b233c338fa4572a37
4
- data.tar.gz: eeacddeebc0117e15dd7096d881d9a818eade8485a2d12f0e6565e0a5e015e56
3
+ metadata.gz: 8fd72dc90871b00a99363ab1df95c2716dfdee0b9e34547ee41ee159a3e0e144
4
+ data.tar.gz: c33ff8c2f1f9a35f4c0d35883879f329c0f837399c43dcc14e4da06ab5e5e27a
5
5
  SHA512:
6
- metadata.gz: 1989097d43b0a33d92b8adf5059d50d360250e5f967ca5bf60aa1e62b7703131fe95d2a21a803a78a1861d71ccb26b7cd5eda8cc8abaff384c70249091d00047
7
- data.tar.gz: b8bc4a5015c9e93dd4433222aedbd842469691ed69c2bcac393d6743156ed792ec7b41fa9cdae571f1b635f48ccb84792264de18846bf5ea2b3b58f4a612eae9
6
+ metadata.gz: 1a8bb20571fe87eb59bf027d8fa002f684a4d4f35e649a8bba45f656317ddded477fcc8b747103927d696f30c9c7b71448bcb922207a30144c1e238632bd9d1d
7
+ data.tar.gz: ebe8730554ea3ca5b4e62b679e78919cad243eb409a5bdeb7d4a633431078829b921fa0dfa04aaaf0c55c3bea181b644c3da986690a8c038e59562ace8bfae89
data/CHANGELOG.md CHANGED
@@ -1,5 +1,326 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-11-27)
4
+
5
+ Run `bin/rails qube_rails:install:migrations` and `bin/rails db:migrate` before this version
6
+ serves any traffic: it adds `qube_connections.company_file_changed_at` and
7
+ `company_file_revision`, and `qube_quickbooks_records.stale_since`, `missing_since`,
8
+ `review_since` and `review_name`, and every link read filters on them, so without
9
+ the migration every sync fails.
10
+
11
+ ### New
12
+
13
+ **A connection switched to another company file**
14
+ - `connection.company_file_changed` (the customer chose "Use a different company file" on the
15
+ connection's setup page) sets the connection back to `pending`, clears `stall_reason`, marks
16
+ its `qube_quickbooks_records` rows stale (`stale_since`, ids kept), deletes its sync marks, and
17
+ sets `company_file_changed_at` and `company_file_revision`, under the row's lock with the
18
+ revision check. One that comes after a later event (a retry landing after `connected`) still
19
+ forgets the file when it's newer than `company_file_revision` and runs the hook, leaving
20
+ `status` and `revision` alone; a redelivery does nothing. Then the new
21
+ `ConnectionEvents#company_file_changed(event)` hook runs (it logs by default; the install
22
+ generator's template has it). Pages with a run going on the connection refresh, as for a stall.
23
+ - A stale link is never used: `qb_id_for`, `find_linked`, `quickbooks_record`, `in_quickbooks`,
24
+ `not_in_quickbooks` and `SyncStatus` read current links only (`QuickbooksRecord.current`,
25
+ `.stale`, `.missing`, `.under_review`, `#stale?`, `#missing?`, `#under_review?`;
26
+ `Connection#stale_links`, `#missing_links`). `link` makes the row it writes current.
27
+ - `QubeRails::LinkCheck`: on the next `connection.connected` it queues a plain request per kind
28
+ with stale links (`<kind>.query` by up to 50 ListIDs or TxnIDs, as the gem's
29
+ `Operations::INDEX` `id_param` says, else the engine's `TXN_KINDS` / `LIST_KINDS`; a kind with
30
+ neither is kept as missing when the check starts, and reported). An id found with the same name (case and spacing ignored), or kept
31
+ without a name, is current again with the answer's EditSequence. One found under another name is
32
+ held for review (`review_since`, `review_name`, unused): ids carry their record's creation time,
33
+ so a shared id means a copied file, and a rename may be a repurposed record.
34
+ `Connection#confirm_link(link)` makes it current with QuickBooks' name, `#reject_link(link)`
35
+ makes it missing; `#review_links`, `#link_under_review?`. One not found is kept as missing
36
+ (`missing_since`, unused). The next company file change makes all of them stale again. An id the answer
37
+ leaves out is missing (QuickBooks' 500 warning still returns every id it has); an answer with rows it didn't ask for
38
+ or an odd shape, or to a check queued before the last company file change, settles nothing.
39
+ After each batch the new
40
+ `ConnectionEvents#links_checked(kind:, found:, relinked:, review:, missing:, stale_left:)` runs
41
+ (it logs by default). `Connection#check_stale_links` starts the checks again by hand.
42
+ - `Operation.start` and `Request.queue` raise `QubeRails::LinkBeingChecked` for a record whose link
43
+ is still stale on the connection (`Connection#checking_link?`), first queuing its kind's check
44
+ again when the last one ended (or never got an answer) over `LinkCheck::RETRY_AFTER` (5 minutes)
45
+ ago, and `QubeRails::LinkNeedsReview`
46
+ for one under review (both `NotReady`), so nothing is sent for it until its link is settled.
47
+ - `SyncStatus` ignores a run made before `company_file_changed_at`: a record sent to the old file
48
+ reads `:not_sent` until its link is checked.
49
+ - `POST quickbooks/connections/:id/company_file` (`connection_company_file_path`): renews the
50
+ connection's links and redirects to its `links.company_file`. 404 for a simulated connection.
51
+ - `render "qube_rails/manage_connection", connection:`: "Set up QuickBooks again" and, unless
52
+ it's simulated, "Use a different company file", while the connection is connected or stalled.
53
+ New keys `connection.set_up_again` and `connection.use_different_company_file`;
54
+ `Connection#set_up?`, `#simulated?` and `#company_file_switchable?`.
55
+ - The vendored webhook test vectors have `connection.company_file_changed`.
56
+
57
+ ### Changed
58
+
59
+ **Offered records, a decline and a search at once** (in place of 0.2.1's branch at a time)
60
+ - Offered records, a decline and a search show at once. Beside a decline, every record's button
61
+ and the decline are secondary. A decline that says what it is as a row (title, action, lines:
62
+ resolve's "Riverbend · new customer in QuickBooks · Add as new") is a row among the records;
63
+ any other ("None of these") is a button just under them (`QuestionView#alongside`,
64
+ `.qube-choice-alongside`), not in the footer. Without a decline the first record is still the
65
+ main action. Cancel is alone in the footer.
66
+ - A search beside offered records is its box alone under them (`QuestionView#searches`, new
67
+ partial `question/_inline_search`, `.qube-search-inline`, new key `question.search_quickbooks`,
68
+ `FieldView#placeholder`, `FieldView#inline?`). Picking a match answers nothing: the match shows
69
+ as a row like the offered ones, focused, and the box empties for another search; a second pick
70
+ replaces it. That row is a slot the page renders hidden and empty (`PickedView`,
71
+ `ChoiceView#slot?` and `#data`), posting the search's choice with the match. A search that finds
72
+ nothing makes the decline the main action, unless a match was picked.
73
+ - A search's list opens only for the box being focused or typed in, and a box under offered
74
+ records never shows the error edge: its pick is a row of its own.
75
+ - The branch pattern is gone: `QuestionView#chain?`, `#branch`, `#branch_part`, `#shown_part?` and
76
+ `#joined_exits`, `data-qube-branch*` and "← Back to the possible match". An override of
77
+ `_question`, `_footer` or `_choice` copied from 0.2.1 that calls them needs updating, and an
78
+ override of `_pick` must render `choice.data` and hide `choice.slot?`. `question.none_of_these`
79
+ and `question.back_to_offered` are unused.
80
+ - An offered record's button is described by the record's name (`aria-describedby`,
81
+ `ChoiceView#label_id`), so a screen reader says which record "Use this one" picks. The search box
82
+ under offered records is hidden until the script runs, since it can't search without it.
83
+
84
+ **A name clash leads with the existing record**
85
+ - A choice about one record can carry `title`, `action`, `lines` (each split on " · ") and
86
+ `facts` (`{label, value}`), in place of `detail`: `ChoiceView#title`, `#action`, `#lines`,
87
+ `#facts` (`FactView`), `#row?`; `.qube-pick-line`, `.qube-pick-facts`, `.qube-pick-fact`,
88
+ `.qube-pick-fact-label`.
89
+ - `ensure`'s ask_use shows the existing record's row (QuickBooks' stored name, its lines, and
90
+ Company, Balance, Added) with "Use existing" as the main action. Adding it under another name
91
+ waits behind "or add it under another name…" (new key `question.disclose_choice`,
92
+ `QuestionView#disclosed` and `#mid_sentence`, new partial `question/_disclosure`, a `<details>`
93
+ with `.qube-choice-disclosure` and `data-qube-disclosure`); opened, its submit is the main
94
+ action and the focus goes to its first field. A refusal of its answer opens it.
95
+
96
+ **An offered record's button is its only target**
97
+ - An offered record's row (`.qube-pick`) is now a `div`, and its "Use this one"
98
+ (`.qube-pick-action`) is the submit button: a click on the record's name or details does
99
+ nothing. A row without its own button (a plain option) is still a button whole. Styles keyed
100
+ on `button.qube-pick` for an offered record need `.qube-pick`.
101
+
102
+ **Smaller**
103
+ - Option rows sit on a quiet fill rather than a border, so they aren't boxes inside the card.
104
+ - The storyboard's search in a rows field returns only records of the row's kind, as QuBe Sync's
105
+ search scopes by `row`. Its notes say in plain words what brings each screen up and what your
106
+ user can do.
107
+
108
+ ## 0.2.1 (2026-11-17)
109
+
110
+ Connections keep their type, so workflows aren't started on standard ones, and run webhooks are
111
+ read as QuBe Sync now sends them. Run `bin/rails qube_rails:install:migrations` and
112
+ `bin/rails db:migrate`.
113
+
114
+ ### Added
115
+
116
+ **Connections and onboarding**
117
+ - `qube_connections.connection_type` (`realtime`, `standard` or `simulated`), set when Connect
118
+ makes the connection and kept up to date by the connection's events; `Connection#standard?` and
119
+ `Connection#refresh_type!` (reads it from QuBe Sync after an upgrade in the dashboard).
120
+ - Connect (`POST quickbooks/connections`) takes `type=realtime` or `type=standard`, else
121
+ `config.connection_type`; any other type answers 422. It sends back through setup only a
122
+ never-connected connection of that type.
123
+
124
+ **Starting workflows**
125
+ - `Operation.start` on a standard connection raises `QubeRails::RealtimeRequired` before writing a
126
+ run or calling QuBe Sync.
127
+ - A start QuBe Sync refuses with 422 `realtime_required` keeps its run, as state
128
+ `realtime_required` with `error` `{code, detail}`, rather than failing it. The run status shows
129
+ the detail and the "Try sending again" button, and `run.retry_start!` (or starting again) sends
130
+ it with the same Idempotency-Key once the connection is upgraded: QuBe Sync stores nothing for
131
+ that refusal.
132
+
133
+ **Questions**
134
+ - A rows field (`add_transaction`'s `ask_missing`) of two records or more asks one record at a
135
+ time: a step count ("1 of 3", `aria-live`), Back and Next in the form's button row (see
136
+ Changed), the question's submit on the last record only, "Set all to:" hidden. Every record
137
+ stays in the form, so the answer is still one POST with every row. It needs the script (see
138
+ Changed). New keys `question.step`, `question.back`, `question.next`; the rows partial carries
139
+ them and the `button` / `button_secondary` classes as `data-qube-*` attributes.
140
+ - The question screen has no horizontal rules: its sections (the details, the choices, the footer,
141
+ each record of a rows field, the "or" between choices) are set apart by space alone.
142
+ - Choices are weighed by the `role` QuBe Sync now sends with each (`pick`, `search`, `decline`,
143
+ `cancel`, `answer`): the offered records as option rows with no heading of their own (the
144
+ question's message says what they are), the first one's "Use this one" the screen's primary button and the
145
+ rest secondary; a search after them, a branch at a time (see below), or a section of its own
146
+ when nothing is offered; decline in the footer; cancel at the start of the footer row, as a ghost. An answer shows by its shape, as before. Without roles (an
147
+ older QuBe Sync), choices show by their shape as before. `ChoiceView#role` and `#cancel?`,
148
+ `QuestionView#roles?`, `#matches?` and `#ui_text` (the one lookup for the engine's new words,
149
+ "Possible matches" and the step line; `RowsView#ui_text` defers to it); forms carry
150
+ `data-qube-choice-role`. New CSS only for cancel's place in the footer row; the heading and
151
+ buttons use classes the stylesheet already styles.
152
+ - Offered records with a search (a chain, `QuestionView#chain?`) show a branch at a time. The
153
+ offered records come first, the footer row holding cancel and "Not this one" / "None of these"
154
+ (new key `question.none_of_these`, `data-qube-branch="search"`); that swaps them for the search,
155
+ with "← Back to the possible match" / "← Back to the %{count} possible matches" above it (new key
156
+ `question.back_to_offered`, `.qube-branch-back`, `data-qube-branch="offered"`), its button row
157
+ holding cancel, the decline and its submit (the footer's forms, through `form=`). Moving to the
158
+ search focuses its box, Back the first record, and what was typed or picked stays. A refusal of
159
+ the search's answer starts on the search. Each part carries `data-qube-branch-part` ("offered" or
160
+ "search"), `hidden` when not on show; `QuestionView#branch`, `#branch_part`, `#shown_part?`,
161
+ `#offered_count`, `#joined_exits`, `#divided?`. Without the script a chain shows the records and
162
+ a footer of cancel and the decline, as forms that post. Other questions are unchanged.
163
+ - Motion for a chain: a branch the person moves to comes in from its side over 200 ms (the
164
+ search from the right, the records from the left; the script sets `data-qube-branch-moved`, so
165
+ a page load is still), and "Use this one" fades in as a match is picked. With reduced motion
166
+ both only fade.
167
+ - A search's button row that also holds the decline puts its end on top and cancel under it in a
168
+ question narrower than 44rem, before and after a pick, so "Use this one" arriving moves nothing.
169
+ - A search's submit ("Use this one") is hidden until a match is picked (`ChoiceView#waits_for_pick?`),
170
+ then shows as the primary button; after a search of two characters or more that finds nothing,
171
+ the decline is the primary button until a pick or a search that finds matches. Until either,
172
+ nothing in that row is primary.
173
+ - `question.step` reads "%{position} of %{count}" ("1 of 2"): the record's block already names its
174
+ kind. A `%{name}` in your own wording still works.
175
+ - The storyboard's questions carry roles and QuBe Sync's current wording ("It's not in QuickBooks",
176
+ "Not listed? Search QuickBooks", "Don't add the invoice").
177
+
178
+ **Run status**
179
+ - `run.headline`, every event's sentence for a person (`qube_runs.headline`), shown for an ended
180
+ run whose reason doesn't already say it (`.qube-run-headline`).
181
+ - `Run#with_errors?`: an outcome such as `push_records`' `pushed_with_errors` reads "Done, but some
182
+ didn't go through" (`status.done_with_errors`) and adds `.qube-run-with-errors`.
183
+
184
+ ### Changed
185
+
186
+ **The question's layout: one button row**
187
+ - A form choice ends in one button row (`.qube-choice-actions`, new `ui_classes` piece
188
+ `choice_actions`): cancel at the start, as a ghost; at the end, the right edge of the fields
189
+ above, the submit with any other exit beside it. When a question has one form, no picks and no
190
+ exit with a description, its exits' buttons join that row and submit their own (hidden, empty)
191
+ forms through the `form` attribute, so it works without the script; new partials
192
+ `question/_submit` and `question/_exit_button`. Otherwise the exits have their own row, laid out
193
+ the same way: cancel at the start, decline and the like at the end, or stacked with cancel last
194
+ when they have descriptions. Cancel is now always at the start (it was at the far right, or the
195
+ left when it had a description).
196
+ - A rows field in steps puts its step count ("2 of 3"), Back and Next in that row, before the
197
+ submit, instead of a step line above the records and a row of its own; the row reads cancel …
198
+ 2 of 3, Back, Next (or the submit on the last record).
199
+ - The question card has sections: a hairline under what it's about, another above the way out
200
+ (the exits' row, or a lone form's button row). A card that is one form is as wide as the form;
201
+ a chain's search keeps the width its offered records had.
202
+ - Beside full-width picks (a near match, a name clash) a form takes the full width too, so its
203
+ submit shares the picks' and exits' right edge.
204
+ - A form's fields and button row share one column (`--qube-form-width`, 36rem; a rows field takes
205
+ the whole width), so the submit lines up with the fields' right edge.
206
+ - On a narrow question (a container under 30rem) the row's end comes first, its buttons filling
207
+ the line, and cancel goes under it.
208
+ - A choice promoted to an option row (name clash's "Use the existing record") ends in a secondary
209
+ "Use this one" button, as an offered record's does, not a link.
210
+ - The question card keeps a gap under the record's status when it follows it.
211
+
212
+ **Decisions from the review**
213
+ - No submit or Next is disabled any more: the browser's own validation (required fields, a search's
214
+ "Pick one of the matches.") says what's missing and focuses it, and Next on an incomplete record
215
+ does the same.
216
+ - A field that isn't required says "(optional)" after its label (`question.optional`); a checkbox
217
+ doesn't.
218
+ - After a cancel is posted the status reads "Cancelling…" (`status.cancelling`, run state
219
+ `cancelling`, the engine's own) until the run's next event; a quiet one offers redelivery as a
220
+ running one does.
221
+ - A rows field needs the script: it and its submit are hidden until the script runs, and a
222
+ `<noscript>` line says answering needs JavaScript (`question.needs_script`). Cancel still works.
223
+ - A ghost button with no `button_ghost` piece takes no host class (it took `button_secondary`'s), so
224
+ cancel and "← Back to the possible match" keep the engine's quiet look.
225
+
226
+ **Styling and Tailwind**
227
+ - The stylesheet sits in the `components` cascade layer, after declaring `@layer theme, base,
228
+ components, utilities;`. Unlayered, the engine's rules beat every Tailwind v4 utility class
229
+ (`ui_classes` couldn't change a padding or a background); now utilities and any unlayered app CSS
230
+ win, and Tailwind v4's preflight (`@layer base`) still doesn't strip the engine's look. Tailwind
231
+ v3's preflight is unlayered and does reset borders, button backgrounds and paddings: give those
232
+ pieces classes, or use v4 (README, "Styling").
233
+ - The generated initializer, `Configuration#ui_classes=` and the README show Tailwind classes first;
234
+ Bootstrap is a second, shorter example (with `form-check-input mt-0`).
235
+ - `qube_rails_assets` adds `data-turbo-track="reload"` to both tags: under Turbo Drive a page kept
236
+ the old script after an update (and the script's once-per-page guard skipped the new one), which
237
+ is how a browser could still show Back and the submit on two rows after that fix.
238
+
239
+
240
+ - A failed run's `error` is QuBe Sync's `{code, type, message, quickbooks_message, hint}`:
241
+ `reason_text` is its message and `error_detail` its hint. An error stored by 0.2.0 (a sentence,
242
+ or code, message and detail) still reads.
243
+ - A run's `cancel_url` is cleared when it ends; `links.decisions` and `links.search` may be absent.
244
+ - A `rows` field's boolean columns answer `true` or `false`, not the text `"true"`.
245
+ - The storyboard's sample prompts drop `options`, which run webhooks no longer carry.
246
+
247
+ ### Fixed
248
+
249
+ - A start keeps the run's `run_url`: it's read from the start answer's `links.self` (a
250
+ `WorkflowRun`'s), falling back to `links.run` (a webhook's). 0.2.0 read only `run`, so it stayed
251
+ nil.
252
+ - A start QuBe Sync refuses with a 4xx (other than 409 and `realtime_required`) keeps why on the
253
+ failed run: `error` is `{code: "refused", message, detail}`, the message a sentence from the
254
+ answer's body (field errors joined, or its sentence) and the detail its status. The run status
255
+ shows it in place of "it couldn't be sent".
256
+ - A search's picked match shows as the selection: a check in the box and an accent edge
257
+ (`data-qube-picked`, set by the script), cleared as soon as the text changes.
258
+ - `link_references` takes add_transaction's new shapes (QuBe Sync's docs/workflow-record-events.md): a
259
+ `records` notification (`data.records`, each with `paths`, `action`, `kind`, `sent` and `record`,
260
+ linked as each pass settles them, with the record's name and edit sequence) or an ending's
261
+ `output.refs` (`{path => {list_id, type}}`). The block still gets the path and an entry
262
+ (`list_id`, `type`, and from a notification `kind`, `action`, `full_name`, `edit_sequence`, `sent`).
263
+ `output.references` is no longer read: QuBe Sync doesn't send it.
264
+ - A search box focused empty (or cleared) lists the first active records of its list (QuBe Sync's
265
+ search with `q` empty), so an account can be picked without knowing its name; the search route
266
+ passes an empty `q` through.
267
+ - A rows column's `default` (QuBe Sync's new prompt key, one of its `enum` values) starts checked or
268
+ selected, and counts for the other columns' `when`, so add_transaction's missing records start at
269
+ "Create it". A blank rows label shows no heading. The storyboards' cancel reads "Cancel adding the
270
+ invoice", with no note.
271
+ - A ghost button's description (Cancel's "Stop here. Nothing is created.") starts where the
272
+ button's text does. The storyboard's missing-records question uses QuBe Sync's new wording.
273
+ - Motion in the question: a pick's check pops in (240ms) and the box's tint eases in; fades only
274
+ under reduced motion.
275
+ - A pick's detail wraps between its parts (`similar name ·`, the email, the phone), each a
276
+ `.qube-detail-part`, so a phone number no longer breaks across lines and no line starts with
277
+ the separator.
278
+ - An exit's hidden form beside a lone form (`detached`) no longer takes a row of the choices' grid,
279
+ which left blank space under the buttons: `.qube-choice` set `display` and won over `hidden`. The
280
+ layer's last rule now hides a `hidden` `.qube-choice`, `.qube-choice-button` and
281
+ `[data-qube-branch-part]` (zero specificity, so it has to come after the rules that set display).
282
+ - A search box with text but no pick shows its error edge once the focus leaves it, not while
283
+ it's being typed in (after a first try it was red through every later search).
284
+ - A search's "No matches" or failed-search note is a line under the box, in flow, not a floating
285
+ list over the buttons below it.
286
+ - On the last record of a rows field, Back and the question's submit share a row: the step nav
287
+ (`data-qube-step-nav`) now sits where the form's submit was and holds it, after Back and Next.
288
+ - After a 409 (or a 400 such as `not_awaiting_input`) for an answer, the run reads as running
289
+ ("Syncing with QuickBooks") rather than "Needs your answer" with no question shown, and the
290
+ message (new key `errors.question_moved_on`) no longer says the page shows the latest. A newer
291
+ question already on the run is left alone. In 0.2.0 too. A one-shot error now shows under the
292
+ status line, inside the status block, not above it.
293
+ - "Use for all N" is now "Use for the other record too" / "Use for the other %{count} records too"
294
+ (`question.use_for_all`, pluralized; a plain string still works), and once pressed it's replaced
295
+ by a note, "Also filled in on the other record." (new key `question.used_for_all`), until the
296
+ value changes. A record filled while hidden in a later step flashes the fill tint as it comes on
297
+ show, so nothing changes out of sight unannounced.
298
+ - A refused answer (422) keeps what was typed: the choice's text, number, select and checkbox
299
+ fields come back filled, marked `aria-invalid` and described by the refusal, which now shows
300
+ inside the question rather than above the run status. The refusal travels in
301
+ `flash[:qube_rails_refusal]` (`token`, `choice`, `message`, `values`), shown only on the question
302
+ it was for; values over 1,000 characters aren't kept (cookie sessions). `_error` takes an `id:`.
303
+ - Phone width: a wrapped button no longer touches its border (`.qube-choice-button` has 8px block
304
+ padding, `box-sizing: border-box`); under 30rem an offered record's "Use this one" goes under its
305
+ text, full width, so an email in its detail isn't broken mid-word; a search match's detail is
306
+ split into `.qube-detail-part`s like a pick's, so a phone number doesn't break at its hyphen.
307
+ - With a host class on the search input (Bootstrap's `form-control`), the picked check no longer
308
+ overlaps the text: the script sets the room for it inline. A segment's label stays centred when
309
+ a reset sets `label { display: inline-block }` (padding and `text-align`, not flex alone).
310
+ - A select starts on "Choose…" (new key `question.choose`) rather than a blank row.
311
+ - A search the route answers 409 (the question changed) says "This question has changed. Reload
312
+ the page to see the latest." (new key `question.search_changed`, `data-qube-text-search-changed`)
313
+ rather than "No matches"; any other failed answer says the search isn't available.
314
+
315
+ ### Compatibility
316
+
317
+ Matches QuBe Sync's reshaped workflow-run webhooks (qube PR #61): the error object, `headline`,
318
+ an `output` per outcome without `output.outcome` (add_transaction's `added` keeps `record` and
319
+ `references`, so `link_references` is unchanged), links only while they work, no
320
+ `prompt.options`, and `summary.changes` in place of `summary.side_effects` (the engine read
321
+ neither). Webhooks in the old shape are still read. The start's 422 `realtime_required` answer is
322
+ the same before and after that change.
323
+
3
324
  ## 0.2.0 (2026-10-27)
4
325
 
5
326
  A rewrite on QuBe Sync's v2 API. The engine now holds the code QuBe Sync's integration kit used to