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

Method new

crates/opencode-tui/src/components/session.rs:52–68  ·  view source on GitHub ↗
(context: Arc<AppContext>, session_id: String)

Source from the content-addressed store, hash-verified

50
51impl SessionView {
52 pub fn new(context: Arc<AppContext>, session_id: String) -> Self {
53 Self {
54 context,
55 session_id,
56 scroll_offset: 0,
57 rendered_line_count: 0,
58 messages_viewport_height: 0,
59 expanded_reasoning: HashSet::new(),
60 thinking_toggle_hits: Vec::new(),
61 last_messages_area: None,
62 line_to_message: Vec::new(),
63 message_first_lines: HashMap::new(),
64 sidebar_state: SidebarState::default(),
65 sidebar_close_button_area: None,
66 sidebar_open_button_area: None,
67 }
68 }
69
70 pub fn render(&mut self, frame: &mut Frame, area: Rect, prompt: &Prompt) {
71 let show_sidebar = *self.context.show_sidebar.read();

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected