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>
41 lines
1.5 KiB
Haskell
41 lines
1.5 KiB
Haskell
module Web.View.InstitutionalKnowledge.Show where
|
|
|
|
import Web.View.Prelude
|
|
|
|
data ShowView = ShowView
|
|
{ entry :: !InstitutionalKnowledgeEntry
|
|
, hub :: !Hub
|
|
, mDecision :: !(Maybe DecisionRecord)
|
|
}
|
|
|
|
instance View ShowView where
|
|
html ShowView { .. } = [hsx|
|
|
<div class="p-6 max-w-3xl">
|
|
<div class="mb-4">
|
|
<a href={InstitutionalKnowledgeAction} class="text-sm text-blue-600 hover:underline">
|
|
← Knowledge Base
|
|
</a>
|
|
</div>
|
|
<div class="bg-white shadow rounded-lg p-6">
|
|
<div class="flex justify-between items-start mb-4">
|
|
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">{hub.name}</span>
|
|
<span class="text-xs text-gray-400">{show entry.createdAt}</span>
|
|
</div>
|
|
<p class="text-gray-800 leading-relaxed text-sm">{entry.summary}</p>
|
|
{maybe mempty renderSourceDecision mDecision}
|
|
</div>
|
|
</div>
|
|
|]
|
|
|
|
renderSourceDecision :: DecisionRecord -> Html
|
|
renderSourceDecision dr = [hsx|
|
|
<div class="mt-5 border-t pt-4">
|
|
<p class="text-xs font-medium text-gray-500 uppercase mb-2">Source Decision</p>
|
|
<a href={ShowDecisionRecordAction (dr.id)}
|
|
class="text-sm text-blue-600 hover:underline">
|
|
{dr.title}
|
|
</a>
|
|
<span class="ml-2 text-xs text-gray-500">({dr.outcome})</span>
|
|
</div>
|
|
|]
|