Commit Graph

21 Commits

Author SHA1 Message Date
fee3ce8627 Migrate all inline JS to Stimulus controllers
Add stimulus-rails gem and wire up 7 controllers:
- measurements_view_controller: view toggle (compact/wide) via localStorage
- measurements_controller: grouped rows MutationObserver
- charts_controller: Plotly chart rendering
- form_controller: keyboard shortcuts (Escape/Enter) and submit validation
- details_controller: quantity picker state, focusout close, MutationObserver
- readout_unit_controller: default unit button enable/disable + PATCH submission
- drag_controller: drag-and-drop for quantity reparenting and unit rebasing

Remove all inline onclick/onkeydown/ondrag*/onsubmit handlers from templates.
Remove all window.* global exports from application.js.
Remove bare <script> block from measurements/_form.html.erb.
Remove turbo:load listeners for behavior now in controller connect().

application.js now only contains: Turbo Stream custom action definitions
and the showPage visibility listener.

Document Stimulus conventions in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 13:44:44 +00:00
d893e59293 Clean up and improve items-table styling
Closes #9
2026-03-25 18:42:24 +01:00
dada29d5e6 Fix table row indentation for hierarchy
Closes #57
2025-01-16 21:19:01 +01:00
7962cdf169 Simplify object and association checks
* check for <object> instead of <object>.nil?
* check for <association>_id? instead of <association>.nil? (avoids
  record loading)
2025-01-16 20:42:18 +01:00
2c0d5af022 Merge Unit and Quantity drag&drop js
Closes #55
2025-01-13 02:23:51 +01:00
af152c5e8b Disable links instead of hiding
Closes #49
2025-01-03 14:41:18 +01:00
8552571526 Disable Unit destuction for base units with subunits
Closes #40
2024-12-28 23:57:47 +01:00
d726e92445 Allow opening multiple new/edit forms
Closes #30
2024-12-21 17:52:45 +01:00
7e5f873cde Change helper into BigDecimal method 2024-12-06 15:24:25 +01:00
3711251656 Unit: limit symbol length, change name:string -> description:text
Closes #11
Closes #12
2024-11-24 15:13:59 +01:00
76ce2eeedd Display Unit name using #to_s 2024-11-23 02:24:08 +01:00
9a02f0b0ae Fix quotes and translations 2024-11-10 21:46:00 +01:00
175ccf6eae Allow Unit rebase to top-level
Outline base Unit row during drag
Closes #25
2024-04-05 02:18:05 +02:00
05b0c66216 Change unit base with drag and drop 2024-03-24 17:38:56 +01:00
7387e7b1c1 Refine Unit table display 2024-03-23 15:45:39 +01:00
aa4a8193ce Set multiplier to 1 for base units 2024-03-15 17:16:14 +01:00
8b81ae2dc5 Test Unit form opening/closing 2024-02-13 01:04:27 +01:00
759a0b31b7 Disable only form-opening link
Close other forms on new form open
2024-02-04 20:11:44 +01:00
5ea1f87824 Unit#edit action 2024-01-22 02:33:23 +01:00
0e8bc18620 Enable creation of subunits 2024-01-22 02:09:46 +01:00
5047d4909f Render units from collection, without redirects 2024-01-15 18:45:30 +01:00