Module: Labimotion::MatriceLabimotion
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/labimotion/models/concerns/matrice_labimotion.rb
Overview
The LabIMotion side of a host's UI-feature model — whatever this gem needs to read out of the per-feature JSON configs an admin edits.
Today that is one thing: which users may reach the AI integration. Named for the seam rather than for that one job, so the next setting we need from a feature's configs lands beside it instead of in a second concern mixed into the same model.
The division throughout: which users are allowed is the HOST's decision and the host's data — an admin edits the lists on the UI Features page and they live in the host's own table. What the answer MEANS is LabIMotion's: which generic types have an AI integration, that auto-fill is a sub-gate rather than a separate one, and that every step is closed by default. So the shape lives here and the storage stays there, the same division the rest of this gem keeps with its host.
Chemotion holds the configs on its Matrice model, which includes this:
class Matrice < ApplicationRecord
include Labimotion::MatriceLabimotion
end
A host supplying it needs two things: the including model must answer
find_by(name:) with a record exposing a configs hash, and its user must
answer matrix_check_by_name(name) with whether that feature is on for them
at all. Both already hold for the model this was extracted from.
The configs a feature may carry:
{ "ai_uids": [109, 147], "fill_uids": [109] }
Constant Summary collapse
- AI_FEATURES =
UI features whose JSON configs may carry an AI whitelist. Each one gates the LabIMotion AI integration of its own generic type (the designer's "New (AI)" / "Fine-tune with AI" buttons, and — for genericElement — the AI auto-fill in the element detail view).
%w[genericElement segment genericDataset].freeze
- FILL_FEATURE =
The feature carrying the auto-fill whitelist. Only this one has a
fill_uidslist: auto-fill is the AI action ordinary users reach, in the element detail view, while the designer's "New (AI)" buttons on the other two types are admin-only and need no second gate. 'genericElement'