From 7d00f35990bcbc617edb467b1a8d48a96d9147ab Mon Sep 17 00:00:00 2001
From: Pim Hutting
Date: Thu, 15 Jan 2026 09:04:32 +0100
Subject: [PATCH] feat: made unachieve norm possible
also small fix of formatting keywords said -> keyword said in plan
as we are only able to detect single keywords
(multiple keywords are possible with inferred beliefs)
ref: N25B-400
---
src/pages/MonitoringPage/Components.tsx | 13 ++++++++++---
src/pages/MonitoringPage/MonitoringPage.tsx | 4 ++--
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/pages/MonitoringPage/Components.tsx b/src/pages/MonitoringPage/Components.tsx
index 0f9ea51..6a0d67b 100644
--- a/src/pages/MonitoringPage/Components.tsx
+++ b/src/pages/MonitoringPage/Components.tsx
@@ -9,7 +9,7 @@ const sendUserInterrupt = async (type: string, context: string) => {
const response = await fetch("http://localhost:8000/button_pressed", {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ type, context }),
+ body: JSON.stringify({type, context}),
});
if (!response.ok) throw new Error("Backend response error");
console.log(`Interrupt Sent - Type: ${type}, Context: ${context}`);
@@ -134,13 +134,20 @@ export const StatusList: React.FC = ({
if (item.id === undefined) return null;
const isActive = !!activeIds[item.id];
const showIndicator = type !== 'norm';
- const canOverride = showIndicator && !isActive;
+ const canOverride = showIndicator && !isActive || (type === 'cond_norm' && isActive);
const isCurrentGoal = type === 'goal' && idx === currentGoalIndex;
const handleOverrideClick = () => {
if (!canOverride) return;
- sendUserInterrupt("override", String(item.id));
+ if (type === 'cond_norm' && isActive){
+ {/* Unachieve conditional norm */}
+ sendUserInterrupt("override_unachieve", String(item.id));
+ }
+ else {
+
+ sendUserInterrupt("override", String(item.id));
+ }
};
return (
diff --git a/src/pages/MonitoringPage/MonitoringPage.tsx b/src/pages/MonitoringPage/MonitoringPage.tsx
index cc9026c..58a096d 100644
--- a/src/pages/MonitoringPage/MonitoringPage.tsx
+++ b/src/pages/MonitoringPage/MonitoringPage.tsx
@@ -139,7 +139,7 @@ const MonitoringPage: React.FC = () => {
let prefix = "";
if (t.condition && typeof t.condition !== "string" && "keyword" in t.condition && typeof t.condition.keyword === "string") {
- prefix = `if keywords said: "${t.condition.keyword}"`;
+ prefix = `if keyword said: "${t.condition.keyword}"`;
} else if (t.condition && typeof t.condition !== "string" && "name" in t.condition && typeof t.condition.name === "string") {
prefix = `if LLM belief: ${t.condition.name}`;
} else { //fallback
@@ -183,7 +183,7 @@ const MonitoringPage: React.FC = () => {
label: (() => {
let prefix = "";
if (n.condition && typeof n.condition !== "string" && "keyword" in n.condition && typeof n.condition.keyword === "string") {
- prefix = `if keywords said: "${n.condition.keyword}"`;
+ prefix = `if keyword said: "${n.condition.keyword}"`;
} else if (n.condition && typeof n.condition !== "string" && "name" in n.condition && typeof n.condition.name === "string") {
prefix = `if LLM belief: ${n.condition.name}`;
}