Nest organizations under a parent org - #2473
Conversation
a9d8e43 to
2af9ea3
Compare
| controller: "remote-select", | ||
| remote_select_model_value: "organization", | ||
| remote_select_exclude_value: ([ f.object.id ] + f.object.descendants.map(&:id)).compact.join(","), | ||
| remote_select_truncate_chars_value: 22 |
There was a problem hiding this comment.
I can see why you added this. My personal suggestion would be to just place the search box under the Org name input so they would be the same width. This search box is tiny in this position (so not a great experience typing) and drives the need for this extra remote-select code added in the PR.
I don't love added extra things to the remote-select controller if we can help it because it is used in so many places. Keeping it simple will help keep it maintainable.
This is an example of my concern about design driving the code instead of taking a design compromise with simpler code.
There was a problem hiding this comment.
@jmilljr24 was thinking same to back out of remote-select change anyway just to not touch it. still, having it be an expandable box that wraps text isn't a great ui everywhere it is, so was considering this signal enough to make the needed change, not this was driven by a short width placement.
|
@jmilljr24 since you've already reviewed, i'll take out the remote-select change and would love to merge and not wait. |
Mirrors FileMaker's Organization ParentID so the FM organizations import can group the split Adult/Children program records under one org roof. Structural only (no roll-up), arbitrary-depth tree with cycle protection. Refs #508 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Applies to every remote-select record picker: a long value (e.g. a parent org name) now ellipsizes on one line rather than doubling the control height. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Only the parent-org picker truncates its long selected label; every other remote-select keeps its existing wrapping behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- remote-select truncation is now a fixed ch-width cap (truncate-chars value) driving a CSS var, never exceeding the control width - selected item carries a title tooltip so the full label shows on hover - when a parent is saved, the picker label becomes a jump link (new tab) to the parent org's profile Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the truncation/tooltip changes to the shared remote-select controller; the parent-org picker no longer opts into a width cap. The clickable jump-link label to the parent's profile stays. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2a09bd5 to
c163faf
Compare
jmilljr24
left a comment
There was a problem hiding this comment.
Sounds good. I thought the title had something to do with changes in staging.
This looks good matching the FM pattern. Would love to know your thoughts some other time about the structure and if it's something we would eventually want to move away with or if its a good db pattern.
🤖 suggested review level: 3 Read 📖 new self-referential nesting on Organization — a migration + a few model/view additions, no wide blast radius
Organizations can now sit under a parent "roof" org, so the FileMaker import can pull the historically-split Adult/Children program records back under one organization — staff wanted them grouped, not duplicated.
Closes #508
What's here
parent_idself-FK (belongs_to :parent/has_many :children), mirroring FileMaker's OrganizationParentID. Arbitrary depth, with#ancestors/#descendants/#roothelpers.dependent: :nullify) rather than deleting real programs.remote-selectpattern, excludes self + descendants). The profile shows the relationship both ways: a "Part of …" link up and a "Nested organizations" list down.Notes for the reviewer
docs/adr/0004-nested-organizations.md.