Skip to content

feat(ai): show tool call details and AI radio config in UI - #1070

Merged
cosven merged 6 commits into
masterfrom
ai-ui
Sep 1, 2026
Merged

cosven merged 6 commits into
masterfrom
ai-ui

Conversation

@cosven

@cosven cosven commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Tool event cards: default shows only the tool name; clicking the card expands to reveal the tool call arguments and the result output. Long content scrolls inside the card. Tool events are driven by langchain callbacks (on_tool_start / on_tool_end / on_tool_error) and are handed off to the GUI thread via queued signals, so display is safe even though tool execution happens on a worker thread.
  • AI radio config: a shared AIRadioConfigView — a subtle footer at the bottom of the playlist — appears when an AI radio session is active. Clicking it expands an inline label showing the current preferences, avoidances and recent feedback notes. Added to both the AI chat sidebar playlist and the main playlist overlay.
  • Copilot.add_callback() API to register extra agent callbacks.
  • i18n keys for the new UI strings (en-US / ja-JP / zh-CN).

Testing

  • AI chat + playlist overlay test suites pass (47 passed, 6 pre-existing failures unrelated to this PR).
  • Verified tool card expand/collapse, worker-thread callback delivery, and radio config footer visibility toggling.

cosven added 2 commits August 31, 2026 09:14
- Tool event cards now show only the tool name by default; clicking
  expands to reveal call arguments and result output, with a scroll
  area for long content. Tool events are driven by langchain callbacks
  (on_tool_start/on_tool_end/on_tool_error) and handed off to the GUI
  thread via queued signals.
- Add a shared AIRadioConfigView: a subtle footer in the AI chat
  sidebar playlist and the playlist overlay that expands inline to
  show the active radio's preferences, avoidances and feedback notes.
- Add Copilot.add_callback() to register extra agent callbacks, plus
  i18n keys and tests.
Comment thread feeluown/gui/uimain/playlist_overlay.py Outdated
self._shadow_width = 15
self._view_options = dict(row_height=60, no_scroll_v=False)
self._player_playlist_view = PlayerPlaylistView(self._app, **self._view_options)
self._ai_radio_config = AIRadioConfigView(self._app, self)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

_ai_radio_config 换个名字 _ai_radio_config_view

Comment thread tests/gui/uimain/test_uimain.py Outdated
def add_callback(self, callback):
self._extra_callbacks.append(callback)

def _fire_tool_start(self, name, inputs=None):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

这个函数移除,依赖它的测试代码也移除

- Rename _ai_radio_config to _ai_radio_config_view in PlaylistOverlay.
- Remove the _fire_tool_start test helper and the tool-event assertions
  that depended on it.
- Remove test_ai_chat_body_and_sidebar_use_distinct_background_roles and
  the six pre-existing failing tests that referenced removed titlebar,
  header and AI radio status code.
- Drop now-unused imports (QEvent, MidHeader, sys, AIChatOverlay,
  TextButton, ChatSendButton).
- Fix flake8 by removing leftover unused imports in ai_chat.py.
- library_search no longer creates a search_result artifact or returns
  artifact_id; search result songs are cached directly so they can still
  be played by URI.
- Remove add_search_result/add_search_result_artifact, the result field
  on CopilotArtifact, and related prompt text and tests.
- Wrap over-long prompt lines to satisfy flake8.
PyQt6 requires flags() to return QFlags<Qt.ItemFlag>; returning a plain
int for invalid indexes raises TypeError in the C++ view layer.
@cosven
cosven merged commit 77c9b48 into master Sep 1, 2026
0 of 12 checks passed
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.

1 participant