Repository navigation
feat: show weekly SUS early from 1 h and firm at a shared 12 h maturity #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
75ca293
feat: show weekly SUS early from 1 h and firm at a shared 12 h maturity
HemSoft c505e20
refactor: keep existing functions' complexity for the metrics gate
HemSoft 2d324f3
test: expect the early SUS in the Gemini weekly capture
HemSoft 771517a
test: keep production coverage for the early SUS paths
HemSoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| //! A synthetic Claude week through the production parser and views: n/a, early from 1 hour, firm from 12 hours. | ||
| use super::{save, settle}; | ||
| use crate::{dashboard::Dashboard, theme::Appearance}; | ||
| use chrono::Duration; | ||
| use gpui_kit::test::TestWindowExt as _; | ||
| use gpui_kit::{AnyWindowHandle, AppContext as _, AsyncApp, Entity}; | ||
| use std::path::Path; | ||
|
|
||
| /// Each age into an 8%-used week, its screenshot name, its SUS label, and whether its bar forecasts. | ||
| pub(crate) fn states() -> [(Duration, &'static str, &'static str, bool); 6] { | ||
| [ | ||
| (Duration::minutes(59), "59m", "Weekly: SUS n/a, unavailable", false), | ||
| (Duration::hours(1), "1h", "Weekly: SUS 7 early, early estimate", false), | ||
| (Duration::hours(6), "6h", "Weekly: SUS 45 early, early estimate", false), | ||
| ( | ||
| Duration::hours(12) - Duration::minutes(1), | ||
| "11h59m", | ||
| "Weekly: SUS 89 early, early estimate", | ||
| false, | ||
| ), | ||
| (Duration::hours(12), "12h", "Weekly: SUS 89, yellow", true), | ||
| ( | ||
| Duration::hours(15) + Duration::minutes(55), | ||
| "15h55m", | ||
| "Weekly: SUS 84, yellow", | ||
| true, | ||
| ), | ||
| ] | ||
| } | ||
|
|
||
| pub(super) async fn run( | ||
| cx: &mut AsyncApp, | ||
| handle: AnyWindowHandle, | ||
| dashboard: &Entity<Dashboard>, | ||
| dir: &Path, | ||
| ) -> Vec<String> { | ||
| let wide = std::env::var_os("CODEXBAR_CAPTURE_WIDE").is_some(); | ||
| let layout = if wide { "wide" } else { "compact" }; | ||
| let mut saved = Vec::new(); | ||
| for (appearance, theme) in [(Appearance::Light, "light"), (Appearance::Dark, "dark")] { | ||
| cx.update(|cx| crate::prefs_hub::PrefsHub::set_appearance(cx, appearance)); | ||
| for (age, name, sus, forecasts) in states() { | ||
| cx.update(|cx| dashboard.update(cx, |d, cx| d.capture_claude_weekly(age, cx))); | ||
| settle(cx).await; | ||
| cx.update(|cx| { | ||
| cx.update_window(handle, |_, window, cx| { | ||
| window.render_frame(cx); | ||
| let id = if wide { | ||
| "window-weekly-claude-bar-sus" | ||
| } else { | ||
| "focus-metric-1-sus" | ||
| }; | ||
| assert_eq!(window.find(id).label(), Some(sus), "{name}"); | ||
| let ring = window.find("focus-share").label().unwrap().to_owned(); | ||
| assert_eq!(ring.contains("at reset"), forecasts, "{name}: {ring}"); | ||
| }) | ||
| }) | ||
| .expect("the Claude fixture must reach the actual table and weekly card"); | ||
| let name = format!("claude-weekly-{name}-{layout}-{theme}"); | ||
| assert!(save(cx, handle, dir, &name)); | ||
| saved.push(name); | ||
| } | ||
| } | ||
| saved | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.