Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.8 KB
Raw Blame
<%# Answer-style selects under the composer: how the next answer is written.
    One control per dimension, showing the stored step and offering the other
    two -- the six pills this replaced spelled out every step permanently and
    filled the whole line under a 380px panel.

    Auto-submit on change, the established pattern for a select that IS a
    setting (scope chip, meetings overview, time session groups). The response
    is a turbo_stream, which Turbo applies wherever it lands, so this form
    deliberately carries NO turbo_frame: it does not navigate anything. %>
<%# `contents`: this element stays as the turbo_stream replace target, but its
    children join the SHARED row that ChatContainerComponent lays out -- style
    and length are two settings of one thing and belong on one line. %>
<div class="<%= dom_class %> contents">
  <% dimensions.each do |dimension| %>
    <div class="flex items-center gap-1.5">
      <span class="text-xs text-faint"><%= group_label(dimension) %></span>
      <%# aria-label rather than a <label for>: the panel and a chat page can
          render this control into ONE document, and a generated field id would
          be the duplicate the DOM class above is careful to avoid. Same reason
          the scope chip labels itself this way. %>
      <%= form_with url: update_path(dimension), method: :patch,
                    data: { controller: 'auto-submit' }, class: 'contents' do |form| %>
        <%= form.select :level,
                        options_for_select(level_options(dimension), selected_level(dimension)),
                        {},
                        name: 'level', id: nil,
                        class: select_classes(dimension),
                        aria: { label: group_label(dimension) } %>
      <% end %>
    </div>
  <% end %>
</div>