Add analysis preview to case list
Introduce a `preview_lines` setting in `users.toml` to control the number of visible lines for the analysis preview in the case list. This feature extracts the first paragraph of the `document.md` file, strips markdown formatting, and displays it, capped by the configured `preview_lines`. The actual line clamping is handled client-side via CSS `line-clamp`.
This commit is contained in:
@@ -33,6 +33,7 @@ fn make_user(slug: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ fn test_config() -> Arc<Config> {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}],
|
||||
api_keys: HashMap::from([("test-key-123".into(), "dr_test".into())]),
|
||||
..Config::test_default()
|
||||
|
||||
@@ -25,6 +25,7 @@ fn make_user(slug: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ fn make_user(slug: &str, password_plain: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ fn make_user(slug: &str, password_plain: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ fn make_user(slug: &str, password_plain: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ fn make_user() -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ fn test_config() -> (Arc<Config>, PathBuf) {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}],
|
||||
api_keys: HashMap::from([(TEST_KEY.into(), TEST_SLUG.into())]),
|
||||
..Config::test_default()
|
||||
|
||||
@@ -36,6 +36,7 @@ fn user_with_retention(slug: &str, auto_close_days: u32, auto_delete_days: u32)
|
||||
auto_delete_days,
|
||||
},
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ fn make_user(slug: &str) -> User {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ fn test_config_with_whisper(whisper_url: String) -> Arc<Config> {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}],
|
||||
whisper_url,
|
||||
whisper_timeout_seconds: 5,
|
||||
|
||||
@@ -76,6 +76,7 @@ async fn transient_whisper_failure_is_reenqueued_and_recovers() {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}];
|
||||
let config = Arc::new(cfg);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ fn test_config() -> Arc<Config> {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}],
|
||||
api_keys: HashMap::from([("test-key-123".into(), "dr_test".into())]),
|
||||
..Config::test_default()
|
||||
|
||||
@@ -23,6 +23,7 @@ fn test_config() -> Arc<Config> {
|
||||
whisper: Default::default(),
|
||||
retention: Default::default(),
|
||||
window_hours: 72,
|
||||
preview_lines: 2,
|
||||
}],
|
||||
api_keys: HashMap::from([("test-key".into(), "dr_test".into())]),
|
||||
..Config::test_default()
|
||||
|
||||
Reference in New Issue
Block a user