Files
codex/codex-rs/tui/src/tui/test_support.rs
T
canvrno-oai a0d5fd772e TUI Plugin Sharing 5 - polish remote plugin catalog rows (#26705)
This is the final plugin sharing PR in the 5-PR stack. It applies the
remaining TUI polish for remote plugin catalog rows and tabs:
admin-disabled plugins now read as blocked/view-only instead of looking
toggleable, admin-installed/default-installed plugins count and sort
like installed plugins, plugin search matches richer metadata, and an
empty successful `Shared with me` section stays hidden.

- Admin-disabled rows use a blocked marker, show `Disabled`, and keep
Enter-only detail behavior without a toggle hint.
- Admin-installed/default-installed plugins show as installed in counts,
ordering, tabs, and detail copy.
- Plugin search now matches descriptions and keywords in addition to
existing row metadata.
- Successful-empty `Shared with me` tabs are hidden, while loading,
error, workspace-empty, and real shared-plugin states remain visible.
- Updates coverage in
`plugins_popup_snapshot_shows_all_marketplaces_and_sorts_installed_then_name`,
`plugins_popup_admin_disabled_installed_plugin_has_no_toggle_hint`,
`plugins_popup_search_matches_plugin_descriptions`, and
`plugins_popup_remote_section_fallback_states_snapshot`.
- Updates snapshots `plugins_popup_curated_marketplace` and
`plugins_popup_empty_shared_section_hidden`.


<img width="2034" height="106" alt="image"
src="https://github.com/user-attachments/assets/3f9a57e1-edd8-4e6c-b0b0-9f632a3c9529"
/>
<img width="2038" height="380" alt="image"
src="https://github.com/user-attachments/assets/45a47491-3381-4846-a13d-496bc0051d42"
/>
2026-06-24 18:48:11 -07:00

29 lines
711 B
Rust

use std::io;
use std::io::stdout;
use ratatui::backend::CrosstermBackend;
use ratatui::layout::Position;
use ratatui::layout::Size;
use super::Tui;
use super::terminal_stderr::TerminalStderrGuard;
use crate::custom_terminal::Terminal;
pub(crate) fn make_test_tui() -> io::Result<Tui> {
let backend = CrosstermBackend::new(stdout());
let terminal = Terminal::with_screen_size_and_cursor_position_for_test(
backend,
Size {
width: 80,
height: 24,
},
Position { x: 0, y: 0 },
);
let stderr_guard = TerminalStderrGuard::install()?;
Ok(Tui::new(
terminal,
/*enhanced_keys_supported*/ false,
stderr_guard,
))
}