Skip to content

Chat: Discover panel surfaces hidden capabilities#69

Merged
lezama merged 1 commit into
mainfrom
ux/chat-discover-panel
May 19, 2026
Merged

Chat: Discover panel surfaces hidden capabilities#69
lezama merged 1 commit into
mainfrom
ux/chat-discover-panel

Conversation

@lezama
Copy link
Copy Markdown
Owner

@lezama lezama commented May 19, 2026

Summary

Adds a "Discover capabilities" panel below the chat UI on the openclaWP Chat admin page. Each row shows one capability surface with a one-line description, a population count or "Not set up yet" hint, and a link to that page.

This is the discovery anchor that complements #68 (hide-when-empty submenu items): with the menu condensed, a first-time user now has one obvious place to see what openclaWP can do.

Refactor

  • OpenclaWP_Admin_Menu_Visibility::is_surface_populated( string $slug ): bool and surface_count( string $slug ): ?int extracted as public static methods so the menu gating and the Discover panel share one source of truth — no risk of disagreeing about whether a capability is set up.
  • New parent_for_slug() wrapper centralises the add_submenu_page parent-resolution pattern; 8 admin classes updated to use it.

Dismissal

The panel is dismissible per user (openclawp_discover_dismissed user meta). The Settings page exposes a "Show it again" affordance only when the current user has dismissed it.

Why

Follow-up to the UX review of the full plugin tour. #68 hid 8 empty surfaces from the sidebar; without a discovery surface, those capabilities would be invisible until something populates them.

Test plan

  • On a fresh install, the Discover panel renders below the chat with all rows showing "Not set up yet".
  • After creating one MCP server, that row shows "1 registered" and an "Open" link.
  • Dismissing the panel persists across page loads for that user only.
  • Settings page shows a "Show it again" link only when dismissed; clicking it clears the dismissal.
  • PHPUnit unit suite: 169/169 (was 165 before, +4 new AdminMenuVisibilityTest cases).

🤖 Generated with Claude Code

…#68)

Adds a "Discover capabilities" panel below the chat UI on the openclaWP
Chat admin page. Each row shows one capability surface with a one-line
description, a population count or "Not set up yet" hint, and a link to
that page.

This is the discovery anchor that complements #68 (hide-when-empty
submenu items): with the menu condensed, a first-time user now has one
obvious place to see what openclaWP can do.

Refactor:
- `OpenclaWP_Admin_Menu_Visibility::is_surface_populated( string $slug )
  : bool` and `surface_count( string $slug ): ?int` extracted as public
  static methods so the menu gating and the Discover panel share one
  source of truth (no risk of disagreeing about whether a capability is
  set up).
- New `parent_for_slug()` convenience wrapper centralises the
  `add_submenu_page` parent-resolution pattern; 8 admin classes updated
  to use it.

The panel is dismissible per user (stored in
`openclawp_discover_dismissed` user meta). Settings page exposes a
"Show it again" affordance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lezama lezama merged commit 802429d into main May 19, 2026
5 of 6 checks passed
@lezama lezama deleted the ux/chat-discover-panel branch May 19, 2026 15:28
lezama added a commit that referenced this pull request May 19, 2026
Adds an `openclawp_agent_file` CPT and a wp-admin → openclaWP → Agent
files surface for authoring markdown documents (AGENTS.md, SOUL.md,
BOOTSTRAP.md, …) that customise agent behaviour without touching PHP.
Files target a specific agent via the `agent_slug` meta, or apply
globally when that meta is empty.

The new submenu is hide-when-empty (PR #68 pattern) and the Discover
panel (PR #69) picks up the new surface automatically through the shared
`OpenclaWP_Admin_Menu_Visibility::surface_count()` helper.

A follow-up PR will wire the file contents into the runtime prompt
assembler so the agent actually reads them — this PR ships the CPT +
admin UI first so admins can start authoring while the runtime side
bakes (TODO note in the store class header).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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