Skip to content

Commit

Permalink
Some quick last UX fixes to the bike tool: #743
Browse files Browse the repository at this point in the history
- after adding lanes, stay on the quick sketch page
- be clear people are uploading proposals in the public domain
- link to docs about mode shift
  • Loading branch information
dabreegster committed Oct 11, 2021
1 parent 15d25b2 commit 5502831
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
6 changes: 5 additions & 1 deletion game/src/common/share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ impl ShareProposal {
}
} else {
let mut txt = Text::new();
txt.add_line(Line("You'll upload this proposal anonymously"));
// The Creative Commons licenses all require attribution, but we have no user accounts
// or ways of proving identity yet!
txt.add_line(Line(
"You'll upload this proposal anonymously, in the public domain",
));
txt.add_line(Line("You can't delete or edit it after uploading"));
txt.add_line(Line(
"(But you can upload and share new versions of the proposal)",
Expand Down
25 changes: 19 additions & 6 deletions game/src/ungap/predict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashSet;
use abstutil::{prettyprint_usize, Counter, Timer};
use geom::{Distance, Duration, Polygon, UnitFmt};
use map_gui::load::FileLoader;
use map_gui::tools::ColorNetwork;
use map_gui::tools::{open_browser, ColorNetwork};
use map_gui::ID;
use map_model::{PathRequest, PathStepV2, RoadID};
use sim::{Scenario, TripEndpoint, TripMode};
Expand Down Expand Up @@ -89,6 +89,11 @@ impl State<App> for ShowGaps {

match self.top_panel.event(ctx) {
Outcome::Clicked(x) => {
if x == "read about how this prediction works" {
open_browser("https://a-b-street.github.io/docs/software/bike_network/tech_details.html#predict-impact");
return Transition::Keep;
}

return Tab::PredictImpact
.handle_action::<ShowGaps>(ctx, app, &x)
.unwrap();
Expand Down Expand Up @@ -139,8 +144,13 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
}

let col = vec![
// TODO Info button with popup explaining all the assumptions... (where scenario data comes
// from, only driving -> cycling, no off-map starts or ends, etc)
ctx.style()
.btn_plain
.icon_text(
"system/assets/tools/info.svg",
"How many drivers might switch to biking?",
)
.build_widget(ctx, "read about how this prediction works"),
percentage_bar(
ctx,
Text::from(Line(format!(
Expand Down Expand Up @@ -172,7 +182,7 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
percentage_bar(
ctx,
Text::from(Line(format!(
"{} / {} trips would switch!",
"{} / {} trips might switch",
data.results.num_trips,
data.all_candidate_trips.len()
))),
Expand Down Expand Up @@ -293,12 +303,15 @@ impl Results {
fn describe(&self) -> Text {
let mut txt = Text::new();
txt.add_line(Line(format!(
"{} total vehicle miles traveled daily",
"{} total vehicle miles traveled daily, now eliminated",
prettyprint_usize(self.total_driving_distance.to_miles() as usize)
)));
// Round to 1 decimal place
let tons = (self.annual_co2_emissions_tons * 10.0).round() / 10.0;
txt.add_line(Line(format!("{} tons of CO2 emissions annually", tons)));
txt.add_line(Line(format!(
"{} tons of CO2 emissions saved annually",
tons
)));
txt
}
}
Expand Down
10 changes: 3 additions & 7 deletions game/src/ungap/quick_sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,9 @@ impl State<App> for QuickSketch {
self.route_sketcher.all_roads(app),
self.top_panel.dropdown_value("buffer type"),
);
return Transition::ConsumeState(Box::new(|state, ctx, app| {
let state = state.downcast::<QuickSketch>().ok().unwrap();
vec![
crate::ungap::ExploreMap::new_state(ctx, app, state.layers),
PopupMsg::new_state(ctx, "Changes made", messages),
]
}));
self.route_sketcher = RouteSketcher::new(ctx, app);
self.update_top_panel(ctx, app);
return Transition::Push(PopupMsg::new_state(ctx, "Changes made", messages));
}
x => {
// TODO More brittle routing of outcomes.
Expand Down

0 comments on commit 5502831

Please sign in to comment.