mirror of
https://github.com/we-promise/sure.git
synced 2026-05-30 15:59:02 +00:00
Remote branch added a beta_gated_nav_item helper + 'Gating the main nav' docs section. Main concurrently renamed the beta-features gate to preview-features (concern, predicate, JSONB key, locale flash). Rename the new helper / partial local / pill marker to match preview naming and port the nav-gating docs into gating-a-preview-feature.md so the improvement survives the rename. Resolved conflicts: - db/schema.rb: take the later schema version (2026_05_19_100000). - docs/llm-guides/gating-a-beta-feature.md: accept main's deletion; port the 'Gating the main nav' section into the preview guide. Renames carried through to keep the gate wired end-to-end: - application_helper.rb: beta_gated_nav_item → preview_gated_nav_item; beta_features_enabled? → preview_features_enabled?; beta: → preview:. - _nav_item.html.erb: beta: local → preview: local; shared.beta i18n key → shared.preview. - application.html.erb: caller renamed to preview_gated_nav_item. - goals/index.html.erb: pill label uses shared.preview. - shared/en.yml: 'beta: Beta' → 'preview: Preview'. - goals_controller, goal_pledges_controller: require_beta_features! → require_preview_features!. - goals_controller_test, goal_pledges_controller_test: flip the preference key, flash matcher, and test names to 'preview'.
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
<%# locals: (name:, path:, icon:, icon_custom:, active:, mobile_only: false, preview: false) %>
|
|
|
|
<%= link_to path, class: "space-y-1 group block relative pb-1", aria: { current: ("page" if active) } do %>
|
|
<div class="grow flex flex-col lg:flex-row gap-1 items-center">
|
|
<%= tag.div class: class_names("w-4 h-1 lg:w-1 lg:h-4 rounded-bl-sm rounded-br-sm lg:rounded-tr-sm lg:rounded-br-sm lg:rounded-bl-none", "bg-nav-indicator" => active) %>
|
|
|
|
<%= tag.div class: class_names(
|
|
"w-8 h-8 flex items-center justify-center mx-auto rounded-lg relative",
|
|
active ? "bg-container shadow-xs text-primary" : "group-hover:bg-surface-hover text-secondary"
|
|
) do %>
|
|
<%= icon(icon, color: active ? "current" : "default", custom: icon_custom) %>
|
|
<% if preview %>
|
|
<span class="absolute -top-0.5 -right-0.5">
|
|
<%= render DS::Pill.new(tone: :violet, dot_only: true, title: t("shared.preview")) %>
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="grow flex justify-center lg:pl-2">
|
|
<%= tag.p class: class_names("font-medium text-[11px]", active ? "text-primary" : "text-secondary") do %>
|
|
<%= name %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|