Skip to content

Prompt api poc#323

Open
NakataCode wants to merge 3 commits intomasterfrom
prompt-api-poc
Open

Prompt api poc#323
NakataCode wants to merge 3 commits intomasterfrom
prompt-api-poc

Conversation

@NakataCode
Copy link
Contributor

🚀 Enhanced AI Chat with Interactive Viewers and Improved UX

📋 Summary

This PR significantly enhances the AI chat interface with interactive JSON/code viewers, improved context awareness, and better user experience. The AI assistant now has full page visibility and provides rich, interactive responses.


✨ Features Added

🎨 Interactive Content Display

  • Interactive JSON Viewer

    • Expandable/collapsible tree structure with ▼/▶ triangles
    • Syntax-highlighted values (strings, numbers, booleans, null)
    • Formatted with proper indentation and structure
  • Enhanced Code Blocks

    • Rendered as styled DOM elements (not plain <pre><code>)
    • Language badges (xml, javascript, etc.) displayed in top-right corner
    • Line-by-line rendering for better readability
    • Fixed strikethrough/crossed-out text rendering issues

🧠 AI Context & Intelligence

  • Full Page Awareness

    • Expanded context includes full bindings data (not just previews)
    • Expanded context includes full aggregations data
    • Control selection automatically updates AI context
  • Smart Session Management

    • Session auto-initializes when Gemini Nano model is ready
    • No manual session creation needed

💎 UX Improvements

  • Token Counter

    • Always visible with current usage (tokens used / quota)
    • Shows percentage used
    • Warning state at 90%+ usage with red background
    • Automatic warning message at 70% usage
  • Custom Confirmation Dialog

    • In-panel modal for "Clear History" action (not browser popup)
    • Centered in AI chat with backdrop overlay
    • Smooth slide-in animation
    • Can dismiss by clicking overlay or Cancel button
  • Context Indicator

    • Shows currently selected control type and ID
    • Clear button (×) to remove context
    • Updates automatically on control selection

@NakataCode NakataCode requested a review from kgogov February 4, 2026 15:30
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.

2 participants