1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Frame layout for the `tm projects` 4-pane TUI (#2118, DOC-35 §5).
//!
//! Why: the spec pins a fixed vertical/horizontal `Layout` — Projects (25%) |
//! Sessions (75%) on top, a fixed-height Activity strip, and a 1-row action
//! bar — mirroring the `Constraint` conventions already used by
//! `tui::coordinator::layout` and `tui::health::render`. Composing the
//! `Rect`s here (rather than in each pane module) keeps the frame's shape in
//! one place.
//! What: [`render`] draws the full frame each tick, delegating each region's
//! content to its [`super::panes`] submodule.
//! Test: the pane submodules unit-test their own content; this terminal-
//! touching composition is exercised by launching the TUI.
use ;
use ;
use ProjectCtlState;
/// Minimum height (rows, including the two border rows) of the main
/// Projects/Sessions row.
///
/// Why: floors the main row so a short terminal still shows a handful of
/// project/session rows rather than collapsing to nothing; taller terminals
/// flex the row larger via `Constraint::Min`.
const MIN_MAIN_ROWS: u16 = 7;
/// Fixed height (rows, including the two border rows) of the Activity pane.
///
/// Why: DOC-35 §5 pins this pane at `Constraint::Length(4)`.
const ACTIVITY_ROWS: u16 = 4;
/// Draw one full frame: Projects | Sessions on top, Activity below, the
/// action bar at the bottom.
///
/// Why: the single entry point the run loop's `terminal.draw` calls each
/// tick.
/// What: splits `frame.area()` vertically into the main row (flexing, floored
/// at [`MIN_MAIN_ROWS`]), the Activity strip ([`ACTIVITY_ROWS`]), and the
/// 1-row action bar; splits the main row horizontally 25/75 for
/// Projects/Sessions per DOC-35 §5. When
/// [`ProjectCtlState::deliverable_view`] is `Some` (DOC-35 §10.8, #2383) or
/// [`ProjectCtlState::config_form`] is `Some` (DOC-35 §6, #2120), a centred
/// overlay floats on top of the whole frame afterward — a strict addition,
/// never replacing a pane, mirroring the dashboard help-overlay's "draw base
/// frame, then float overlay" sequencing. The two are mutually exclusive by
/// construction (see `events`'s module doc), so at most one overlay ever
/// renders in a given frame.