Skip to content

[GSoC 2026] Add context-aware quick-action buttons to the chat panel (refs #3772)#3773

Open
berardifra wants to merge 2 commits into
gsoc-2026/llm-chatbotfrom
gsoc-2026/llm-chatbot-quick-actions
Open

[GSoC 2026] Add context-aware quick-action buttons to the chat panel (refs #3772)#3773
berardifra wants to merge 2 commits into
gsoc-2026/llm-chatbotfrom
gsoc-2026/llm-chatbot-quick-actions

Conversation

@berardifra

@berardifra berardifra commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Add context-aware quick-action buttons to the chat panel

Description

Refs #3772

W9 — quick-action buttons. Completes the context injection story from #3771: the chat drawer now shows clickable chips that suggest queries based on the current page. On a job page, "Summarize this job", "What analyzers ran?", "Show job details"; on an investigation page, "Summarize this investigation", "Show investigation tree"; on other pages, generic chips. Click → populates and sends the message immediately (no second step).

Frontend — frontend/src/components/chat

  • QuickActions.jsx (new) — pure component: receives onSend and disabled, parses window.location.pathname with regexes that mirror the backend derive_page_context, renders <Button outline-secondary size="sm"> chips in a div#quick-actions. Click → onSend(message) with the id resolved ({id} → real number). Chips are disabled while isStreaming or the socket is not connected.
  • ChatPanel.jsxQuickActions inserted between ChatMessageList and ChatComposer; inputDisabled extracted as a shared const.
  • QuickActions.test.jsx (new) — 11 tests: job/investigation/generic chip rendering, sub-page paths, non-numeric id → generic fallback, click with resolved id, click on generic page, disabled state. 3 coupling tests that validate JOB_DETAIL_RE and INVESTIGATION_DETAIL_RE against the known Routes.jsx paths (mirror of the backend coupling test).
  • test_context.py — updated coupling test docstring to cross-reference both sides (backend + frontend).

No store, hook, ChatComposer, or ChatMessageList changes. No backend changes beyond the docstring update.

Demo

quick-actions-demo.mp4

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist

  • I have read and understood the rules about how to Contribute to this project
  • The pull request is for the branch develop (GSoC: targets the gsoc-2026/llm-chatbot umbrella)
  • A new plugin (analyzer, connector, visualizer, playbook, pivot or ingestor) was added or changed, in which case its documentation was added or updated...
  • I have inspected and verified that the API schema is working
  • If external libraries/packages with restrictive licenses were used, they were added in the Legal Notice section (none added)
  • Linters (Black, Flake8, Isort) gave 0 errors.
  • I have added tests for the feature/bug I solved. All the tests (new and old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR. (demo video attached)
    • I have created new frontend tests for the new component or updated existing ones.

Important rules

  • I have read and understood the rules

@mlodic mlodic 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.

cool idea, I added some possible tips


const JOB_ACTIONS = [
{ label: "Summarize this job", message: "Summarize job #{id}" },
{ label: "What analyzers ran?", message: "What analyzers ran on job #{id}?" },

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.

I'd add a more generic "which plugins ran"? In that way it can provide a more comprehensive info about all the plugins executed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed to "Which plugins ran?" so it covers analyzers/connectors/visualizers, not just analyzers.

const JOB_ACTIONS = [
{ label: "Summarize this job", message: "Summarize job #{id}" },
{ label: "What analyzers ran?", message: "What analyzers ran on job #{id}?" },
{ label: "Show job details", message: "Show me the details of job #{id}" },

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.

adding something like "evaluate job results" does it make sense here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the "Evaluate results" chip (Evaluate the results of job #{id}).

{
label: "Show investigation tree",
message: "Show the tree for investigation #{id}",
},

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.

also here, some query that allows the LLM to try to guess something about the content?

is the summarization more generic right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the "Analyze this investigation" chip (What can you tell me about investigation #{id}?).

  - rename 'What analyzers ran?' -> 'Which plugins ran?' (covers connectors/visualizers)
  - add 'Evaluate results' job chip
  - add 'Analyze this investigation' investigation chip

  Refs #3772
@berardifra

Copy link
Copy Markdown
Contributor Author

cool idea, I added some possible tips

All done, thanks. Tell me if u need something better or something new to add :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gsoc-2026 GSoC 2026 - LLM Chatbot project (Francesco Berardi)

Development

Successfully merging this pull request may close these issues.

2 participants