MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / new

Method new

crates/opencode-tui/src/components/dialogs/session_list.rs:41–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40impl SessionListDialog {
41 pub fn new() -> Self {
42 let mut state = ListState::default();
43 state.select(Some(0));
44 Self {
45 sessions: Vec::new(),
46 filtered: Vec::new(),
47 query: String::new(),
48 state,
49 open: false,
50 active_session_id: None,
51 pending_delete_session_id: None,
52 rename_session_id: None,
53 rename_input: String::new(),
54 }
55 }
56
57 pub fn set_sessions(&mut self, mut sessions: Vec<SessionItem>) {
58 sessions.retain(|s| s.parent_id.is_none());

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected