Compare commits
No commits in common. "d63e72ad3531f0cfe172f05658f834cc7e4f4436" and "030d1c2ebe4aae3f60bb0650197b17773718fb09" have entirely different histories.
d63e72ad35
...
030d1c2ebe
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -3168,7 +3168,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-notmuch"
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"log",
|
||||
@ -3183,7 +3183,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-procmail2notmuch"
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -3196,7 +3196,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-server"
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
dependencies = [
|
||||
"ammonia",
|
||||
"anyhow",
|
||||
@ -3219,8 +3219,8 @@ dependencies = [
|
||||
"html-escape",
|
||||
"html2text",
|
||||
"ical",
|
||||
"letterbox-notmuch 0.17.44",
|
||||
"letterbox-shared 0.17.44",
|
||||
"letterbox-notmuch 0.17.43",
|
||||
"letterbox-shared 0.17.43",
|
||||
"linkify",
|
||||
"lol_html",
|
||||
"mailparse",
|
||||
@ -3261,10 +3261,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-shared"
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"letterbox-notmuch 0.17.44",
|
||||
"letterbox-notmuch 0.17.43",
|
||||
"regex",
|
||||
"serde",
|
||||
"sqlx",
|
||||
@ -3274,7 +3274,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-web"
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"build-info-build",
|
||||
@ -3286,7 +3286,7 @@ dependencies = [
|
||||
"graphql_client",
|
||||
"human_format",
|
||||
"itertools",
|
||||
"letterbox-shared 0.17.44",
|
||||
"letterbox-shared 0.17.43",
|
||||
"log",
|
||||
"seed",
|
||||
"seed_hooks",
|
||||
|
||||
@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
||||
edition = "2021"
|
||||
license = "UNLICENSED"
|
||||
publish = ["xinu"]
|
||||
version = "0.17.44"
|
||||
version = "0.17.43"
|
||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@ -32,8 +32,8 @@ futures = "0.3.31"
|
||||
headers = "0.4.0"
|
||||
html-escape = "0.2.13"
|
||||
ical = "0.11"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.44", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.44", registry = "xinu" }
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.43", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.43", registry = "xinu" }
|
||||
linkify = "0.10.0"
|
||||
lol_html = "2.3.0"
|
||||
mailparse = "0.16.1"
|
||||
|
||||
@ -2157,28 +2157,28 @@ mod tests {
|
||||
let meta = extract_calendar_metadata_from_mail(&parsed, &body);
|
||||
// Assert detection as Google Calendar
|
||||
assert!(meta.is_google_calendar_event);
|
||||
// Debug: print the rendered HTML for inspection
|
||||
let html = meta.body_html.expect("body_html");
|
||||
|
||||
// Print event date info for debugging
|
||||
for part in parsed.subparts.iter() {
|
||||
if part.ctype.mimetype == TEXT_CALENDAR {
|
||||
if let Ok(ical) = part.get_body() {
|
||||
println!("ICAL data: {}", ical);
|
||||
if let Some(start) = ical.lines().find(|l| l.starts_with("DTSTART:")) {
|
||||
println!("Start date: {}", start);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("Rendered HTML: {}", html);
|
||||
|
||||
// Look for September 11 (Thursday) being highlighted
|
||||
// The calendar should show Sept 11 highlighted with background:#ffd700 and the correct data-event-day
|
||||
assert!(html.contains(r#"data-event-day="2025-09-11""#));
|
||||
assert!(html.contains(r#"background:#ffd700"#));
|
||||
|
||||
// Since 1:00 AM UTC on Friday 9/12 is 6:00 PM PDT on Thursday 9/11, verify times are correct
|
||||
assert!(html.contains("6:00 PM Thu Sep 11, 2025"));
|
||||
// Check that the calendar table highlights Thursday, not Friday
|
||||
// Look for a table header row with days of week (allow whitespace)
|
||||
let thursday_idx = html
|
||||
.find(">\n Thu<")
|
||||
.or_else(|| html.find(">Thu<"))
|
||||
.expect("Should have a Thursday column");
|
||||
let friday_idx = html
|
||||
.find(">\n Fri<")
|
||||
.or_else(|| html.find(">Fri<"))
|
||||
.expect("Should have a Friday column");
|
||||
// Find the first highlighted cell (background:#ffd700)
|
||||
let highlight_idx = html
|
||||
.find("background:#ffd700")
|
||||
.expect("Should highlight a day");
|
||||
// The highlight should be closer to Thursday than Friday
|
||||
assert!(
|
||||
highlight_idx > thursday_idx && highlight_idx < friday_idx,
|
||||
"Thursday should be highlighted, not Friday"
|
||||
);
|
||||
}
|
||||
use super::*;
|
||||
#[test]
|
||||
|
||||
@ -74,7 +74,13 @@
|
||||
{% for week in all_days|batch(7) %}
|
||||
<tr>
|
||||
{% for day in week %}
|
||||
{% if event_days.contains(day) %}
|
||||
{% if event_days.contains(day) && today.is_some() && today.unwrap() == day %}
|
||||
<td
|
||||
data-event-day="{{ day.format("%Y-%m-%d") }}"
|
||||
style="background:#ffd700; color:#222; font-weight:bold; border:2px solid #2196f3; border-radius:4px; text-align:center; box-shadow:0 0 0 2px #2196f3;">
|
||||
{{ day.day() }}
|
||||
</td>
|
||||
{% elif event_days.contains(day) %}
|
||||
<td
|
||||
data-event-day="{{ day.format("%Y-%m-%d") }}"
|
||||
style="background:#ffd700; color:#222; font-weight:bold; border:1px solid #aaa; border-radius:4px; text-align:center;">
|
||||
|
||||
@ -12,7 +12,7 @@ version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
build-info = "0.0.41"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.44", registry = "xinu" }
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.43", registry = "xinu" }
|
||||
regex = "1.11.1"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
sqlx = "0.8.5"
|
||||
|
||||
@ -33,7 +33,7 @@ wasm-bindgen = "=0.2.100"
|
||||
uuid = { version = "1.16.0", features = [
|
||||
"js",
|
||||
] } # direct dep to set js feature, prevents Rng issues
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.44", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.43", registry = "xinu" }
|
||||
seed_hooks = { version = "0.4.1", registry = "xinu" }
|
||||
strum_macros = "0.27.1"
|
||||
gloo-console = "0.3.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user