| 128 |
128 |
|
use makeover_layout::Tone;
|
| 129 |
129 |
|
use quasi_declare::declare;
|
| 130 |
130 |
|
use quasi_router::screen::{Consult, Figure, Meter, Tag};
|
| 131 |
|
- |
use quasi_router::{Action, Chrome, Node, Response, Role, RouteError, Router, Slot};
|
|
131 |
+ |
use quasi_router::{Action, Chrome, Node, Response, Role, RouteError, Router};
|
| 132 |
132 |
|
|
| 133 |
133 |
|
use crate::state::{AppState, DESKTOP_USER_ID};
|
| 134 |
134 |
|
|
| 920 |
920 |
|
///
|
| 921 |
921 |
|
/// `time-summary.js`, which is the report's smaller sibling: the same shape
|
| 922 |
922 |
|
/// over a fixed window the app computes rather than one the reader picks.
|
| 923 |
|
- |
shape summary_panel(panel: &TimeSummaryPanel) -> Slot;
|
|
923 |
+ |
///
|
|
924 |
+ |
/// Public because the day view places it: it is this module's region drawn
|
|
925 |
+ |
/// on [`super::day_planning`]'s screen, the way `time-summary.js` renders
|
|
926 |
+ |
/// into the day sidebar's container. The read that feeds it is
|
|
927 |
+ |
/// [`tracked`], which that screen makes for itself.
|
|
928 |
+ |
pub(super) shape summary_panel(panel: &TimeSummaryPanel) -> Slot;
|
| 924 |
929 |
|
|
| 925 |
930 |
|
region SUMMARY as Group {
|
| 926 |
931 |
|
fed_by Action::get("/timer/summary");
|
| 930 |
935 |
|
}
|
| 931 |
936 |
|
}
|
| 932 |
937 |
|
|
| 933 |
|
- |
/// The day view's tracked-time panel, read and drawn.
|
| 934 |
|
- |
///
|
| 935 |
|
- |
/// Public because the day view places it: it is this module's region drawn on
|
| 936 |
|
- |
/// [`super::day_planning`]'s screen, the way `time-summary.js` renders into the
|
| 937 |
|
- |
/// day sidebar's container.
|
| 938 |
|
- |
pub fn summary(state: &AppState) -> Result<Slot, RouteError> {
|
| 939 |
|
- |
let panel = crate::commands::time_summary_panel(state)
|
| 940 |
|
- |
.map_err(|error| RouteError::internal(error.to_string()))?;
|
| 941 |
|
- |
Ok(summary_panel(&panel))
|
|
938 |
+ |
/// What the day view's tracked-time panel is drawn from.
|
|
939 |
+ |
pub(super) fn tracked(state: &AppState) -> Result<TimeSummaryPanel, RouteError> {
|
|
940 |
+ |
crate::commands::time_summary_panel(state)
|
|
941 |
+ |
.map_err(|error| RouteError::internal(error.to_string()))
|
| 942 |
942 |
|
}
|
| 943 |
943 |
|
|
| 944 |
944 |
|
declare! {
|
| 1005 |
1005 |
|
|
| 1006 |
1006 |
|
/// The day view's panel, as an answer.
|
| 1007 |
1007 |
|
fn summarised(state: &AppState, _request: quasi_router::Request) -> Result<Response, RouteError> {
|
| 1008 |
|
- |
Ok(Response::fragment(SUMMARY, Node::Region(summary(state)?)))
|
|
1008 |
+ |
Ok(Response::fragment(
|
|
1009 |
+ |
SUMMARY,
|
|
1010 |
+ |
Node::Region(summary_panel(&tracked(state)?)),
|
|
1011 |
+ |
))
|
| 1009 |
1012 |
|
}
|
| 1010 |
1013 |
|
|
| 1011 |
1014 |
|
/// Start timing a task from the screen.
|