Files
sure/app/models/provider/metadata.rb
Guillem Arias d037412b8d feat(settings/providers): replace Add another provider CTA with a search + kind filter
Per the design review, the "Add another provider · Browse providers"
card was a redirect to content one scroll-tick away. A search input
plus kind chips lets users self-segment the catalog and is the right
tool once it grows beyond the four to twelve providers we ship today.

- New providers_filter Stimulus controller — case-insensitive free
  text search across name/region/kind, plus a chip group with
  All / Banks / Crypto / Investment that toggle visibility via
  Tailwind's `hidden` class.
- _search_filters partial: search box (count-pluralized placeholder)
  + chip group, ARIA-labelled and aria-pressed for the chips.
- ProviderCard exposes filter_data (target + name/region/kind data
  attrs) so the controller can match without re-rendering.
- Lunchflow's `kind` was "Lunch" — switched to "Bank" so it falls
  under the Banks chip alongside its actual offering (it aggregates
  banks).
- Drops the add_provider_cta partial and its locale entries; adds
  search_filters.* and an empty_filter message.
2026-05-09 11:33:13 +02:00

89 lines
1.9 KiB
Ruby

class Provider
module Metadata
REGISTRY = {
simplefin: {
region: "US",
kind: "Bank",
maturity: :stable,
logo_bg: "bg-blue-600",
logo_text: "SF"
},
lunchflow: {
region: "US",
kind: "Bank",
maturity: :stable,
logo_bg: "bg-orange-500",
logo_text: "LF"
},
enable_banking: {
region: "EU",
kind: "Bank",
maturity: :beta,
logo_bg: "bg-purple-600",
logo_text: "EB"
},
coinstats: {
region: "Global",
kind: "Crypto",
maturity: :beta,
logo_bg: "bg-yellow-500",
logo_text: "CS"
},
mercury: {
region: "US",
kind: "Bank",
maturity: :beta,
logo_bg: "bg-cyan-600",
logo_text: "ME"
},
coinbase: {
region: "Global",
kind: "Crypto",
maturity: :beta,
logo_bg: "bg-blue-500",
logo_text: "CB"
},
binance: {
region: "Global",
kind: "Crypto",
maturity: :beta,
logo_bg: "bg-yellow-400",
logo_text: "BI"
},
snaptrade: {
region: "US / CA",
kind: "Investment",
maturity: :beta,
logo_bg: "bg-green-600",
logo_text: "ST"
},
indexa_capital: {
region: "ES",
kind: "Investment",
maturity: :alpha,
logo_bg: "bg-red-600",
logo_text: "IC"
},
sophtron: {
region: "US",
kind: "Bank",
maturity: :alpha,
logo_bg: "bg-teal-600",
logo_text: "SO"
},
plaid: {
region: "US",
kind: "Bank",
tier: "Paid",
maturity: :stable,
logo_bg: "bg-indigo-600",
logo_text: "PL"
}
}.freeze
def self.for(provider_key)
REGISTRY[provider_key.to_sym] || { logo_text: provider_key.to_s.first(2).upcase, logo_bg: "bg-gray-500" }
end
end
end