generated from coulomb/repo-seed
Convert all remaining `<- paramOrNothing / param / paramOrDefault /
currentUserOrNothing` monadic binds to `let` — these functions are pure
(ImplicitParams-based) in IHP v1.5, so `<-` is a type error in an IO
do-block.
Controllers fixed:
AgentDelegations, AiGovernancePolicies, Annotations, ApiConsumers,
CollectiveProposals, DecisionRecords, DeploymentRecords,
HubCapabilityManifests, HubRoutingRules, InstitutionalKnowledge,
OutcomeCorrelations, RequirementCandidates, TypeRegistries,
WebhookSubscriptions, Widgets,
Api/V2/{Annotations,InteractionEvents,Token}
WebhookSubscriptions: remove orphaned `Right () ->` case arm that was
left inside a bare `unless` block (structural parse error).
Also carries forward all in-progress fixes from the working tree:
helpers (AgentBridge, ApiRateLimit, BottleneckDetector,
CrossHubPropagation, FrictionScore),
views (CanSelect instances, HSX lambda extraction, formFor wrappers),
env/build (envrc GHCi perms, flake.nix Tailwind + GHC resource limits,
static/app.css additional Tailwind output).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.9 KiB
Haskell
48 lines
1.9 KiB
Haskell
module Web.View.LineageEnrichment.Index where
|
|
|
|
import Web.View.Prelude
|
|
|
|
data IndexView = IndexView
|
|
{ hubs :: ![Hub]
|
|
, counts :: ![(Id Hub, Int)]
|
|
}
|
|
|
|
instance View IndexView where
|
|
html IndexView { .. } = [hsx|
|
|
<div class="p-6">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h1 class="text-2xl font-bold text-gray-900">Lineage Enrichment</h1>
|
|
</div>
|
|
<p class="text-sm text-gray-600 mb-6">
|
|
The <code>trg_enrich_lineage</code> trigger automatically enriches
|
|
<code>decision_records.outcome_summary</code> and
|
|
<code>requirement_candidates.outcome_summary</code> on every new
|
|
outcome signal. Use the buttons below to backfill existing records.
|
|
</p>
|
|
<div class="grid grid-cols-1 gap-4">
|
|
{forM_ hubs (renderHubCard counts)}
|
|
</div>
|
|
</div>
|
|
|]
|
|
where
|
|
renderHubCard cs h =
|
|
let unenriched = maybe 0 snd (find (\(hid, _) -> hid == h.id) cs)
|
|
in [hsx|
|
|
<div class="bg-white shadow rounded-lg p-5 flex justify-between items-center">
|
|
<div>
|
|
<h3 class="font-semibold text-gray-900">{h.name}</h3>
|
|
<p class="text-sm text-gray-500 mt-1">
|
|
{show unenriched} decision(s) pending enrichment
|
|
</p>
|
|
</div>
|
|
<form method="POST" action={EnrichLineageAction (h.id)}>
|
|
{csrfTokenTag}
|
|
<button type="submit"
|
|
class="px-3 py-1.5 text-sm bg-green-600 text-white rounded hover:bg-green-700"
|
|
disabled={unenriched == 0}>
|
|
{if unenriched == 0 then "Up to date" else "Enrich Now"}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|]
|