Skip to content

test(coverage): Batch 2 — Copilot UI (InsightCard, CopilotComposer, AiModeIndicator)#134

Merged
qnbs merged 1 commit into
mainfrom
test/coverage-batch-2
Jun 14, 2026
Merged

test(coverage): Batch 2 — Copilot UI (InsightCard, CopilotComposer, AiModeIndicator)#134
qnbs merged 1 commit into
mainfrom
test/coverage-batch-2

Conversation

@qnbs

@qnbs qnbs commented Jun 14, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Coverage lift Batch 2 (plan #3). Three previously-0% Copilot UI components, targeted from the CI V8 per-file branch report.

Component Tests Covers
components/copilot/InsightCard.tsx 6 title/desc render, "Tell me more" (gated by heuristicsOnly → calls sendMessage), "Open view" (gated by actionable + onNavigate)
components/copilot/CopilotComposer.tsx 5 Enter sends / Shift+Enter newline, send disabled when empty or streaming, transient-store draft consume-and-clear
components/copilot/AiModeIndicator.tsx 5 plain mode label, OpenRouter active (free vs paid), circuit-open suffix + pulsing dot, OpenRouter suppression in local mode

Pure test-only PR. Deterministic — Zustand/redux/i18n/service deps mocked; no real timers.

Gates

  • lint ✅ (1331 files) · typecheck ✅ · 16 tests ✅

🤖 Generated with Claude Code


CodeAnt-AI Description

Add coverage for three Copilot UI components

What Changed

  • Added tests for the AI mode indicator to verify the label shown for local, cloud, and OpenRouter modes, including the free-tier label and the circuit-open warning state.
  • Added tests for the composer to confirm Enter sends a trimmed message, Shift+Enter inserts a new line, sending is disabled while empty or streaming, and saved draft text is loaded once then cleared.
  • Added tests for the insight card to confirm it shows the title and description, reveals "Tell me more" only when allowed, and shows "Open view" only for actionable findings with a navigation handler.

Impact

✅ Fewer Copilot UI regressions
✅ Safer message sending behavior
✅ Clearer AI mode status labels

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…deIndicator (Batch 2)

#3 coverage lift — three previously-0% Copilot UI components (targets from CI V8 branch report):
- InsightCard (6): title/desc render, Tell-me-more (gated by heuristicsOnly), Open-view (gated by
  actionable + onNavigate).
- CopilotComposer (5): Enter sends / Shift+Enter newline, send-disabled gating, transient-store
  draft consume+clear.
- AiModeIndicator (5): plain mode label, OpenRouter active (free vs paid), circuit-open suffix +
  pulsing dot, OpenRouter suppression in local mode.

Gates: lint OK (1331 files) | typecheck OK | 16 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qnbs

qnbs commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storycraft-studio Ready Ready Preview, Comment Jun 14, 2026 12:47pm

@codeant-ai

codeant-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

CodeAnt AI is running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 14, 2026
@codeant-ai

codeant-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Sequence Diagram

This diagram shows how the Copilot composer consumes a transient draft, gates sending on input and streaming state, and how insight cards either send contextual follow-up prompts or navigate to the related view, which are the behaviors exercised by the new tests.

sequenceDiagram
    participant User
    participant CopilotComposer
    participant InsightCard
    participant TransientStore
    participant CopilotService
    participant Navigation

    User->>CopilotComposer: Open composer
    CopilotComposer->>TransientStore: Load draft message once and clear it
    User->>CopilotComposer: Type message and press Enter
    CopilotComposer->>CopilotService: Send trimmed message if not empty and not streaming
    User->>InsightCard: Click Tell me more
    InsightCard->>CopilotService: Send contextual question about heuristic finding
    User->>InsightCard: Click Open view on actionable finding
    InsightCard->>Navigation: Navigate to finding target view
Loading

Generated by CodeAnt AI

@codeant-ai

codeant-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@codeant-ai

codeant-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown

CodeAnt AI finished running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qnbs
qnbs merged commit 471701f into main Jun 14, 2026
17 checks passed
@qnbs
qnbs deleted the test/coverage-batch-2 branch June 14, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant