Skip to content

fix(effort): keep effort indicator visible in prompt footer - #1919

Merged
kevincodex1 merged 8 commits into
Twigpine:mainfrom
Hanxcellent:fix/1831-effort-ui
Jul 10, 2026
Merged

kevincodex1 merged 8 commits into
Twigpine:mainfrom
Hanxcellent:fix/1831-effort-ui

Conversation

@Hanxcellent

@Hanxcellent Hanxcellent commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • move the effort indicator out of the transient notification queue and render it as a stable prompt-footer fallback
  • keep transient notifications and active IDE selections ahead of the effort fallback
  • preserve brief-mode footer ownership and add focused coverage for effort fallback, IDE selection precedence, empty notifications, and brief suppression

Fixes #1831

Impact

  • user-facing impact: changing effort via the TUI picker now leaves the active effort visible in the footer instead of disappearing after the old notification timeout
  • developer/maintainer impact: removes the PromptInput effort notification effect, shares the IDE selection predicate, and pins the footer behavior with static-render tests

Testing

  • bun run build via bun run check / bun run smoke
  • bun run smoke via bun run check
  • bun run check (exits 1 locally; compared with origin/main, both have the same 75 unique failing tests and no branch-only failures)
  • focused tests:
    • bun test src/components/PromptInput/Notifications.effort.test.tsx
    • bun test --feature=KAIROS_BRIEF src/components/PromptInput/Notifications.effort.test.tsx
    • CLAUDE_CODE_EFFORT_LEVEL=high bun test --feature=KAIROS_BRIEF src/components/PromptInput/Notifications.effort.test.tsx

Notes

  • provider/model path tested: N/A; this is prompt footer UI behavior only
  • screenshots attached (if UI changed): not attached; this is a one-line terminal footer state covered by static-render tests for the rendered output
  • follow-up work or known limitations: local bun run check currently has existing failures on origin/main; this branch does not add any new failing test cases

Summary by CodeRabbit

  • Bug Fixes

    • Footer messaging now cleanly switches between IDE selection details and effort fallback, preventing both from appearing together.
    • Transient/current notifications with empty content no longer displace the effort footer.
    • Brief-mode now shows effort fallback only for the appropriate view based on the active task context.
    • Effort notifications are no longer auto-injected on startup or when effort changes.
  • Refactor

    • Streamlined notification rendering conditions to make footer selection more reliable.
  • Tests

    • Added test coverage for effort/footer fallback and IDE selection behavior.

Copilot AI review requested due to automatic review settings July 9, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a shared hasIdeSelection helper, moves effort-level display from PromptInput into a persistent Notifications footer fallback with KAIROS brief-ownership handling, and adds tests for updates, notification precedence, IDE selections, and empty notifications.

Changes

Effort footer fallback

Layer / File(s) Summary
Shared IDE selection detection
src/components/IdeStatusIndicator.tsx, src/components/PromptInput/Notifications.tsx
Adds and reuses hasIdeSelection for consistent IDE selection presence checks.
Notifications fallback rendering
src/components/PromptInput/Notifications.tsx
Passes updated props through memoized rendering, computes effort fallback visibility, applies KAIROS ownership rules, and prioritizes active notifications over the fallback.
Remove transient effort notification
src/components/PromptInput/PromptInput.tsx
Removes effort state access and the effect that managed the transient effort-level notification.
Fallback behavior tests
src/components/PromptInput/Notifications.effort.test.tsx
Tests persistent rendering, live effort updates, notification precedence, IDE selection behavior, and KAIROS brief ownership.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PromptInput
  participant Notifications
  participant AppState
  participant NotificationContent
  PromptInput->>Notifications: render notification area
  Notifications->>AppState: read effortValue and notification state
  Notifications->>Notifications: evaluate IDE and KAIROS fallback visibility
  Notifications->>NotificationContent: pass notification and fallback inputs
  NotificationContent->>NotificationContent: render active notification or effort fallback
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address #1831 by making effort a stable footer fallback so it updates immediately and stays visible, with tests for precedence and suppression.
Out of Scope Changes check ✅ Passed The added tests, helper extraction, and footer rendering changes all align with the effort-indicator fix.
Title check ✅ Passed The title is concise, scoped, and accurately summarizes the effort-footer behavior change.
Description check ✅ Passed The description matches the required template and includes Summary, Impact, Testing, and Notes with relevant details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/PromptInput/Notifications.effort.test.tsx`:
- Around line 171-178: Add a `briefFeatureTest` in
`Notifications.effort.test.tsx` to cover the case where `isBriefOnly` is true
but `viewingAgentTaskId` is set, since `briefOwnsGap` should not suppress effort
in that path. Use `renderNotifications` with `effortValue: 'medium'`,
`isBriefOnly: true`, and a non-empty `viewingAgentTaskId`, then assert that the
output does contain the effort text (for example the `medium · /effort` label)
to verify the override behavior in `Notifications`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b80d8e20-4cc1-4219-82ea-20c427961d0f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f85b25 and 79e1462.

📒 Files selected for processing (4)
  • src/components/IdeStatusIndicator.tsx
  • src/components/PromptInput/Notifications.effort.test.tsx
  • src/components/PromptInput/Notifications.tsx
  • src/components/PromptInput/PromptInput.tsx
💤 Files with no reviewable changes (1)
  • src/components/PromptInput/PromptInput.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

Files:

  • src/components/IdeStatusIndicator.tsx
  • src/components/PromptInput/Notifications.effort.test.tsx
  • src/components/PromptInput/Notifications.tsx
src/components/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use React + Ink for terminal UI components under src/components/.

Files:

  • src/components/IdeStatusIndicator.tsx
  • src/components/PromptInput/Notifications.effort.test.tsx
  • src/components/PromptInput/Notifications.tsx
**

⚙️ CodeRabbit configuration file

**: # AGENTS.md - AI Agent Coding Guide

This guide is for AI coding agents working in the OpenClaude repository. Read it before changing code, and also follow CONTRIBUTING.md for contributor policy, PR expectations, review follow-up, and project scope.

Project Snapshot

OpenClaude is a coding-agent CLI for cloud and local model providers. It supports OpenAI-compatible APIs, Anthropic, Gemini, DeepSeek, Ollama, MCP, local backends, slash commands, tools, agents, and a React/Ink terminal UI.

The installed CLI runs on Node.js >=22.0.0. Bun is used for source builds, scripts, dependency management, and tests.

Work Style

  • Keep changes focused on one problem.
  • Prefer existing patterns in the file or nearby module.
  • Avoid unrelated formatting, renames, dependency changes, or broad rewrites.
  • Add or update tests when behavior changes.
  • Update docs when setup, commands, provider behavior, or user-facing behavior changes.
  • For new features, larger refactors, dependencies, or runtime changes, follow the issue-first guidance in CONTRIBUTING.md.

Stack And Conventions

  • TypeScript with strict mode and ESM imports.
  • React + Ink for terminal UI.
  • Bun lockfile and Bun scripts for development workflows.
  • Node runtime for the built CLI.

Common libraries and patterns:

  • chalk for terminal color.
  • commander for CLI argument parsing.
  • execa for child processes.
  • Existing service, provider, settings, permission, and UI patterns over new abstractions.

Repository Map

  • src/commands/ - slash and CLI command implementations.
  • src/components/ - React/Ink UI components.
  • src/services/ - API, MCP, OAuth, wiki, voice, and other service integrations.
  • src/tools/ - tool implementations.
  • src/utils/ - shared utilities.
  • src/integrations/ - provider and model integration metadata.
  • src/entrypoints/ - CLI, MCP, SDK, and generated public types.
  • src/tasks/ - local, remote, workflow, and monitor tas...

Files:

  • src/components/IdeStatusIndicator.tsx
  • src/components/PromptInput/Notifications.effort.test.tsx
  • src/components/PromptInput/Notifications.tsx
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/components/IdeStatusIndicator.tsx
  • src/components/PromptInput/Notifications.effort.test.tsx
  • src/components/PromptInput/Notifications.tsx
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/components/PromptInput/Notifications.effort.test.tsx
🪛 React Doctor (0.5.8)
src/components/PromptInput/Notifications.tsx

[warning] 286-286: This component misses React Compiler's automatic memoization & re-renders more than it should: Hooks must always be called in a consistent order, and may not be called conditionally. See the Rules of Hooks (https://react.dev/warnings/invalid-hook-call-warning). Rewrite the flagged code so the compiler can optimize it.

(hooks)

🔇 Additional comments (3)
src/components/IdeStatusIndicator.tsx (1)

13-26: LGTM!

src/components/PromptInput/Notifications.tsx (1)

284-314: Effort fallback logic is correct.

Precedence chain is sound: transient notification (notificationNode) → effort fallback (effortFallbackNode) → nothing. Empty-text notifications correctly leave notificationNode as null (empty string is falsy), so the effort fallback fills in. getEffortNotificationText returning undefined for unsupported models safely produces a null fallback node. The briefOwnsGap / shouldShowIdeSelection gating matches the PR objectives.

The React Doctor warning at line 286 is a false positive — feature() is a compile-time constant with an existing biome-ignore pattern, so hook call order is stable at runtime. Same pattern as VOICE_MODE and isBriefOnly above.

Source: Linters/SAST tools

src/components/PromptInput/Notifications.effort.test.tsx (1)

48-96: 🎯 Functional Correctness

No action needed here. useMainLoopModel() already prefers mainLoopModelForSession, then mainLoopModel, then the default, so this test is wired to the intended model.

			> Likely an incorrect or invalid review comment.

Comment thread src/components/PromptInput/Notifications.effort.test.tsx Outdated

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two test coverage issues that need to be addressed before this is ready.

Findings

  • [P2] Add a mounted update regression for the /effort change path
    src/components/PromptInput/Notifications.effort.test.tsx:105
    Issue #1831 is not only that the footer eventually disappears; it also says the displayed effort does not update immediately after changing /effort. The current "uses current app state" test renders two separate AppStateProvider initial states (highOutput and lowOutput), so it would not catch a regression where Notifications only reads the initial effortValue and fails to repaint when the existing store is updated by /effort. Please add a mounted-state regression that starts with one effort value, updates effortValue through the same AppState store, and asserts the rendered footer changes to the new effort without remounting the component.

  • [P2] Complete CodeRabbit's brief-mode coverage request
    src/components/PromptInput/Notifications.effort.test.tsx:171
    The patch now depends on the briefOwnsGap = isBriefOnly && !viewingAgentTaskId branch, which means effort is suppressed in brief mode only while the main prompt owns the footer gap; when a teammate task is being viewed, the effort fallback should render again. The current tests only cover the suppression case with no viewingAgentTaskId, so a future "simplification" could drop the teammate-view exception and still leave this new test file green. CodeRabbit has an unresolved requested change for exactly this branch, and the repo's contributor policy requires automated review findings to be addressed before maintainer review proceeds. Please add the requested briefFeatureTest case with isBriefOnly: true, a non-empty viewingAgentTaskId, and an assertion that medium · /effort renders.

Copilot AI review requested due to automatic review settings July 10, 2026 03:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 10, 2026
jatmn
jatmn previously approved these changes Jul 10, 2026

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the previously discussed paths and do not see any remaining actionable issues from my side.

@kevincodex1 LGTM

Copilot AI review requested due to automatic review settings July 10, 2026 06:05
@Hanxcellent
Hanxcellent dismissed stale reviews from jatmn and coderabbitai[bot] via b761084 July 10, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hanxcellent Hanxcellent changed the title fix: keep effort indicator visible in prompt footer fix(effort): keep effort indicator visible in prompt footer Jul 10, 2026

@kevincodex1 kevincodex1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kevincodex1
kevincodex1 merged commit b588c26 into Twigpine:main Jul 10, 2026
5 checks passed
hotmanxp pushed a commit to hotmanxp/openclaude that referenced this pull request Jul 12, 2026
…#1919)

* fix: keep effort indicator visible

* fix: preserve footer status for effort fallback

* fix: simplify effort footer selection logic

* fix: harden effort footer fallback

* test: cover brief effort footer suppression

* fix: ignore empty footer notifications

* test: cover live effort footer updates

* fix: handle empty JSX footer notifications
hotmanxp pushed a commit to hotmanxp/openclaude that referenced this pull request Jul 12, 2026
…#1919)

* fix: keep effort indicator visible

* fix: preserve footer status for effort fallback

* fix: simplify effort footer selection logic

* fix: harden effort footer fallback

* test: cover brief effort footer suppression

* fix: ignore empty footer notifications

* test: cover live effort footer updates

* fix: handle empty JSX footer notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/effort UI does not update immediately after changing effort and eventually disappears

4 participants