feat(theme): Refine NERV palette contrast and readability

This commit is contained in:
2026-03-09 01:13:23 -04:00
parent 4ae606928e
commit 9facecb7a5
8 changed files with 144 additions and 33 deletions

View File

@@ -222,6 +222,9 @@ class App:
is_md = label in ("message", "text", "content")
ctx_id = f"heavy_{label}_{id_suffix}"
is_nerv = theme.is_nerv_active()
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
if len(content) > COMMS_CLAMP_CHARS:
imgui.begin_child(f"heavy_text_child_{label}_{id_suffix}", imgui.ImVec2(0, 80), True)
if is_md:
@@ -234,6 +237,8 @@ class App:
markdown_helper.render(content, context_id=ctx_id)
else:
markdown_helper.render_code(content, context_id=ctx_id)
if is_nerv: imgui.pop_style_color()
# ---------------------------------------------------------------- gui
@@ -1367,7 +1372,10 @@ def hello():
if is_thinking:
val = math.sin(time.time() * 10 * math.pi)
alpha = 1.0 if val > 0 else 0.0
imgui.text_colored(imgui.ImVec4(1.0, 0.39, 0.39, alpha), "THINKING...")
c = vec4(255, 100, 100, alpha)
if theme.is_nerv_active():
c = vec4(255, 50, 50, alpha) # More vibrant for NERV
imgui.text_colored(c, "THINKING...")
imgui.separator()
# Prior session viewing mode
if self.is_viewing_prior_session:
@@ -1405,7 +1413,10 @@ def hello():
if len(content) > 80: preview += "..."
imgui.text_colored(vec4(180, 180, 180), preview)
else:
is_nerv = theme.is_nerv_active()
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(content, context_id=f'prior_disc_{idx}')
if is_nerv: imgui.pop_style_color()
imgui.separator()
imgui.pop_id()
@@ -1563,15 +1574,21 @@ def hello():
content = entry["content"]
pattern = re.compile(r"\[Definition: (.*?) from (.*?) \(line (\d+)\)\](\s+```[\s\S]*?```)?")
matches = list(pattern.finditer(content))
is_nerv = theme.is_nerv_active()
if not matches:
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(content, context_id=f'disc_{i}')
if is_nerv: imgui.pop_style_color()
else:
imgui.begin_child(f"read_content_{i}", imgui.ImVec2(0, 150), True)
if self.ui_word_wrap: imgui.push_text_wrap_pos(imgui.get_content_region_avail().x)
last_idx = 0
for m_idx, match in enumerate(matches):
before = content[last_idx:match.start()]
if before: markdown_helper.render(before, context_id=f'disc_{i}_b_{m_idx}')
if before:
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(before, context_id=f'disc_{i}_b_{m_idx}')
if is_nerv: imgui.pop_style_color()
header_text = match.group(0).split("\n")[0].strip()
path = match.group(2)
code_block = match.group(4)
@@ -1584,10 +1601,15 @@ def hello():
self.show_text_viewer = True
if code_block:
# Render code block with highlighting
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(code_block, context_id=f'disc_{i}_c_{m_idx}')
if is_nerv: imgui.pop_style_color()
last_idx = match.end()
after = content[last_idx:]
if after: markdown_helper.render(after, context_id=f'disc_{i}_a')
if after:
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(after, context_id=f'disc_{i}_a')
if is_nerv: imgui.pop_style_color()
if self.ui_word_wrap: imgui.pop_text_wrap_pos()
imgui.end_child()
else:
@@ -1850,7 +1872,10 @@ def hello():
if is_live:
val = math.sin(time.time() * 10 * math.pi)
alpha = 1.0 if val > 0 else 0.0
imgui.text_colored(imgui.ImVec4(0.39, 1.0, 0.39, alpha), "LIVE")
c = imgui.ImVec4(0.39, 1.0, 0.39, alpha)
if theme.is_nerv_active():
c = vec4(80, 255, 80, alpha) # DATA_GREEN for LIVE in NERV
imgui.text_colored(c, "LIVE")
imgui.separator()
ch, self.ui_ai_input = imgui.input_text_multiline("##ai_in", self.ui_ai_input, imgui.ImVec2(-1, -40))
# Keyboard shortcuts
@@ -1905,7 +1930,10 @@ def hello():
# --- Always Render Content ---
imgui.begin_child("response_scroll_area", imgui.ImVec2(0, -40), True)
is_nerv = theme.is_nerv_active()
if is_nerv: imgui.push_style_color(imgui.Col_.text, vec4(80, 255, 80))
markdown_helper.render(self.ai_response, context_id="response")
if is_nerv: imgui.pop_style_color()
imgui.end_child()
imgui.separator()
@@ -1918,7 +1946,10 @@ def hello():
def _render_comms_history_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_comms_history_panel")
imgui.text_colored(vec4(200, 220, 160), f"Status: {self.ai_status}")
st_col = vec4(200, 220, 160)
if theme.is_nerv_active():
st_col = vec4(80, 255, 80) # DATA_GREEN for status in NERV
imgui.text_colored(st_col, f"Status: {self.ai_status}")
imgui.same_line()
if imgui.button("Clear##comms"):
ai_client.clear_comms_log()
@@ -2300,8 +2331,11 @@ def hello():
def _render_mma_dashboard(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_mma_dashboard")
is_nerv = theme.is_nerv_active()
if self.is_viewing_prior_session:
imgui.text_colored(vec4(255, 200, 100), "HISTORICAL VIEW - READ ONLY")
c = vec4(255, 200, 100)
if is_nerv: c = vec4(255, 152, 48) # NERV_ORANGE
imgui.text_colored(c, "HISTORICAL VIEW - READ ONLY")
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_mma_dashboard")
return
# Task 5.3: Dense Summary Line
@@ -2324,7 +2358,9 @@ def hello():
imgui.text(" | Status:")
imgui.same_line()
if self.mma_status == "paused":
imgui.text_colored(imgui.ImVec4(1, 0.5, 0, 1), "PIPELINE PAUSED")
c = imgui.ImVec4(1, 0.5, 0, 1)
if is_nerv: c = vec4(255, 152, 48)
imgui.text_colored(c, "PIPELINE PAUSED")
imgui.same_line()
status_col = imgui.ImVec4(1, 1, 1, 1)
if self.mma_status == "idle": status_col = imgui.ImVec4(0.7, 0.7, 0.7, 1)
@@ -2332,6 +2368,11 @@ def hello():
elif self.mma_status == "done": status_col = imgui.ImVec4(0, 1, 0, 1)
elif self.mma_status == "error": status_col = imgui.ImVec4(1, 0, 0, 1)
elif self.mma_status == "paused": status_col = imgui.ImVec4(1, 0.5, 0, 1)
if is_nerv:
if self.mma_status == "running": status_col = vec4(80, 255, 80) # DATA_GREEN
elif self.mma_status == "error": status_col = vec4(255, 72, 64) # ALERT_RED
imgui.text_colored(status_col, self.mma_status.upper())
imgui.same_line()
imgui.text(" | Cost:")
@@ -2412,7 +2453,9 @@ def hello():
if status == "new":
imgui.text_colored(imgui.ImVec4(0.7, 0.7, 0.7, 1.0), "NEW")
elif status == "active":
imgui.text_colored(imgui.ImVec4(1.0, 1.0, 0.0, 1.0), "ACTIVE")
c = imgui.ImVec4(1.0, 1.0, 0.0, 1.0)
if is_nerv: c = vec4(80, 255, 80)
imgui.text_colored(c, "ACTIVE")
elif status == "done":
imgui.text_colored(imgui.ImVec4(0.0, 1.0, 0.0, 1.0), "DONE")
elif status == "blocked":
@@ -2478,7 +2521,9 @@ def hello():
if any_pending:
alpha = abs(math.sin(time.time() * 5))
imgui.same_line()
imgui.text_colored(imgui.ImVec4(1.0, 0.3, 0.3, alpha), " APPROVAL PENDING")
c = imgui.ImVec4(1.0, 0.3, 0.3, alpha)
if is_nerv: c = vec4(255, 72, 64, alpha) # ALERT_RED
imgui.text_colored(c, " APPROVAL PENDING")
imgui.same_line()
if imgui.button("Go to Approval"):
pass # scroll/focus handled by existing dialog rendering