fix(calendar): header fits its width, soft check boxes; roadmap row
- header labels drop by available header width (window minus rail and pane): Join with an ID and Meet now first, then all; the layout guard caught German labels overflowing at 1024 px with the pane open - work-day chips and empty calendar check boxes use soft fills, list rows are flex_none, the now dot stays inside its column (layout rules) - ROADMAP: Calendar view row (Partial until the live check) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -2,7 +2,7 @@
2
2
3
3
Feature parity with the Microsoft Teams desktop client.
4
4
5
**Parity: 87 %** (103 done, 21 partial, 6 missing of 130). Partial counts half.
5
**Parity: 87 %** (103 done, 22 partial, 6 missing of 131). Partial counts half.
6
6
7
7
## By area
8
8
@@ -18,7 +18,7 @@ Feature parity with the Microsoft Teams desktop client.
18
18
| [Search and navigation](#search-and-navigation) | 100 % | 6 | 0 | 0 |
19
19
| [Presence and people](#presence-and-people) | 100 % | 4 | 0 | 0 |
20
20
| [Look and settings](#look-and-settings) | 100 % | 5 | 0 | 0 |
21
| [Calls and meetings](#calls-and-meetings) | 63 % | 17 | 19 | 6 |
21
| [Calls and meetings](#calls-and-meetings) | 63 % | 17 | 20 | 6 |
22
22
23
23
## Next
24
24
@@ -203,7 +203,8 @@ Feature parity with the Microsoft Teams desktop client.
203
203
| Schedule a meeting | Partial | Calls tab "New meeting": title, people chips, date, start, end (next half hour, 30 min), Repeat (does not repeat, daily, weekdays, weekly), details, Teams meeting always on. Outlook-only home keeps Graph `POST /me/events` with `isOnlineMeeting`. With Google home or extra write targets: Teams join link first, then inserts per target (Outlook with join in location; Google `events.insert`). Settings > Calendar chooses home + dual-write. Body builders unit tested; live Google create needs `TEAMS_GOOGLE_CLIENT_ID` |
204
204
| Answer meeting invitations | Partial | Upcoming rows of invited meetings show Accepted / Tentative / Declined / Respond as a menu with "Send a response" (default on); own meetings say Organizer. Outlook: Graph `accept` / `tentativelyAccept` / `decline` (+ iCalUId fallback). Google: Calendar API attendee `responseStatus` patch with `sendUpdates`. Source shown on calendar blocks |
205
205
| Meeting start reminder | Partial | Toast 5 min before the start of an Upcoming meeting: title, time, Join, Snooze (back at the start or first join). Corner X dismisses for good. Outlook: Snooze and X go to Graph snoozeReminder / dismissReminder; reminderView every 60 s near a meeting. Google: snooze/dismiss stay local only. Live state (green dot) from polled live-meeting state. One chime at the start or first join; quiet with sound off and during Do not disturb or a call. Ctrl+Shift+J joins from the latest. Driven by the polled calendar (Outlook + optional Google merge); push event 128 not wired |
206
| Google Calendar accounts | Partial | Settings > Calendar: Connect Google (OAuth Desktop + PKCE, env `TEAMS_GOOGLE_CLIENT_ID` / optional secret), list calendars, home calendar, extra write targets. Poll merges with Outlook by iCal UID / Teams join URL. Disconnect clears tokens. Manual smoke still needed against a real Google account |
206
| Google Calendar accounts | Partial | Settings > Calendar: Connect Google (OAuth Desktop + PKCE; release builds ship the project client, no user env). Waiting row while the browser finishes (reopen / copy link / cancel). List calendars, home calendar, extra write targets. Poll merges with Outlook by iCal UID / Teams join URL. Disconnect clears tokens. Manual smoke still needed against a real Google account |
207
| Calendar view | Partial | Day, Work week, Week, Month like Teams. Settings > Calendar: default view (Last used by default, the span survives a restart), first day of week (mailbox language region as in Outlook, override), work days and hours read from and saved to the Outlook mailbox, time scale 15/30/60 min, this or next week on a day off. Grid: day number over the weekday name, hour and lighter minor lines, off-hours shaded, now line across the week, title and organizer on one line, series icon, calendar colours. Calendar list pane: mini month, Add calendar, collapsible groups with group check box, Show all. Loads through the sign-in session (no wait for the calling engine), refreshes on the calendar poll, shows loading and a Retry notice per failed source. Demo and unit tested; live check against a real account still open |
207
208
| Pre-join screen | Partial | Join from Upcoming, chat, Join with ID, link or reminder opens a screen in the chat pane: camera preview, camera and mic switches, background menu, camera, microphone and speaker selects, "Computer audio" or "Don't use audio" (audio off in both directions), Join now, Cancel. Camera, mic and devices remembered. 1:1 calls and Meet now skip it. Checked in the demo only |
208
209
| Narrow windows in a call | Done | Controls that do not fit move into "..." (View, Reactions, Raise hand, People, Chat; mic, camera, share, "..." and Leave always stay). Below 960 px, or when a side panel would leave the call under 720 px, the chat list hides; still too narrow, the panel overlays the call. Layout guard checks 640x480, 1280x800, 1920x1080 |
209
210
| Give and take control | Missing | Protocol known (main-channel data channel, action codes 0-11); needs a second person and a security review |
@@ -2,7 +2,7 @@2
2
3
Feature parity with the Microsoft Teams desktop client.3
Feature parity with the Microsoft Teams desktop client.4
4
5
**Parity: 87 %** (103 done, 21 partial, 6 missing of 130). Partial counts half.5
**Parity: 87 %** (103 done, 22 partial, 6 missing of 131). Partial counts half.6
6
7
## By area7
## By area8
8
@@ -18,7 +18,7 @@ Feature parity with the Microsoft Teams desktop client.18
| [Search and navigation](#search-and-navigation) | 100 % | 6 | 0 | 0 |18
| [Search and navigation](#search-and-navigation) | 100 % | 6 | 0 | 0 |19
| [Presence and people](#presence-and-people) | 100 % | 4 | 0 | 0 |19
| [Presence and people](#presence-and-people) | 100 % | 4 | 0 | 0 |20
| [Look and settings](#look-and-settings) | 100 % | 5 | 0 | 0 |20
| [Look and settings](#look-and-settings) | 100 % | 5 | 0 | 0 |21
| [Calls and meetings](#calls-and-meetings) | 63 % | 17 | 19 | 6 |21
| [Calls and meetings](#calls-and-meetings) | 63 % | 17 | 20 | 6 |22
22
23
## Next23
## Next24
24
@@ -203,7 +203,8 @@ Feature parity with the Microsoft Teams desktop client.203
| Schedule a meeting | Partial | Calls tab "New meeting": title, people chips, date, start, end (next half hour, 30 min), Repeat (does not repeat, daily, weekdays, weekly), details, Teams meeting always on. Outlook-only home keeps Graph `POST /me/events` with `isOnlineMeeting`. With Google home or extra write targets: Teams join link first, then inserts per target (Outlook with join in location; Google `events.insert`). Settings > Calendar chooses home + dual-write. Body builders unit tested; live Google create needs `TEAMS_GOOGLE_CLIENT_ID` |203
| Schedule a meeting | Partial | Calls tab "New meeting": title, people chips, date, start, end (next half hour, 30 min), Repeat (does not repeat, daily, weekdays, weekly), details, Teams meeting always on. Outlook-only home keeps Graph `POST /me/events` with `isOnlineMeeting`. With Google home or extra write targets: Teams join link first, then inserts per target (Outlook with join in location; Google `events.insert`). Settings > Calendar chooses home + dual-write. Body builders unit tested; live Google create needs `TEAMS_GOOGLE_CLIENT_ID` |204
| Answer meeting invitations | Partial | Upcoming rows of invited meetings show Accepted / Tentative / Declined / Respond as a menu with "Send a response" (default on); own meetings say Organizer. Outlook: Graph `accept` / `tentativelyAccept` / `decline` (+ iCalUId fallback). Google: Calendar API attendee `responseStatus` patch with `sendUpdates`. Source shown on calendar blocks |204
| Answer meeting invitations | Partial | Upcoming rows of invited meetings show Accepted / Tentative / Declined / Respond as a menu with "Send a response" (default on); own meetings say Organizer. Outlook: Graph `accept` / `tentativelyAccept` / `decline` (+ iCalUId fallback). Google: Calendar API attendee `responseStatus` patch with `sendUpdates`. Source shown on calendar blocks |205
| Meeting start reminder | Partial | Toast 5 min before the start of an Upcoming meeting: title, time, Join, Snooze (back at the start or first join). Corner X dismisses for good. Outlook: Snooze and X go to Graph snoozeReminder / dismissReminder; reminderView every 60 s near a meeting. Google: snooze/dismiss stay local only. Live state (green dot) from polled live-meeting state. One chime at the start or first join; quiet with sound off and during Do not disturb or a call. Ctrl+Shift+J joins from the latest. Driven by the polled calendar (Outlook + optional Google merge); push event 128 not wired |205
| Meeting start reminder | Partial | Toast 5 min before the start of an Upcoming meeting: title, time, Join, Snooze (back at the start or first join). Corner X dismisses for good. Outlook: Snooze and X go to Graph snoozeReminder / dismissReminder; reminderView every 60 s near a meeting. Google: snooze/dismiss stay local only. Live state (green dot) from polled live-meeting state. One chime at the start or first join; quiet with sound off and during Do not disturb or a call. Ctrl+Shift+J joins from the latest. Driven by the polled calendar (Outlook + optional Google merge); push event 128 not wired |206
| Google Calendar accounts | Partial | Settings > Calendar: Connect Google (OAuth Desktop + PKCE, env `TEAMS_GOOGLE_CLIENT_ID` / optional secret), list calendars, home calendar, extra write targets. Poll merges with Outlook by iCal UID / Teams join URL. Disconnect clears tokens. Manual smoke still needed against a real Google account |206
| Google Calendar accounts | Partial | Settings > Calendar: Connect Google (OAuth Desktop + PKCE; release builds ship the project client, no user env). Waiting row while the browser finishes (reopen / copy link / cancel). List calendars, home calendar, extra write targets. Poll merges with Outlook by iCal UID / Teams join URL. Disconnect clears tokens. Manual smoke still needed against a real Google account |207
| Calendar view | Partial | Day, Work week, Week, Month like Teams. Settings > Calendar: default view (Last used by default, the span survives a restart), first day of week (mailbox language region as in Outlook, override), work days and hours read from and saved to the Outlook mailbox, time scale 15/30/60 min, this or next week on a day off. Grid: day number over the weekday name, hour and lighter minor lines, off-hours shaded, now line across the week, title and organizer on one line, series icon, calendar colours. Calendar list pane: mini month, Add calendar, collapsible groups with group check box, Show all. Loads through the sign-in session (no wait for the calling engine), refreshes on the calendar poll, shows loading and a Retry notice per failed source. Demo and unit tested; live check against a real account still open |207
| Pre-join screen | Partial | Join from Upcoming, chat, Join with ID, link or reminder opens a screen in the chat pane: camera preview, camera and mic switches, background menu, camera, microphone and speaker selects, "Computer audio" or "Don't use audio" (audio off in both directions), Join now, Cancel. Camera, mic and devices remembered. 1:1 calls and Meet now skip it. Checked in the demo only |208
| Pre-join screen | Partial | Join from Upcoming, chat, Join with ID, link or reminder opens a screen in the chat pane: camera preview, camera and mic switches, background menu, camera, microphone and speaker selects, "Computer audio" or "Don't use audio" (audio off in both directions), Join now, Cancel. Camera, mic and devices remembered. 1:1 calls and Meet now skip it. Checked in the demo only |208
| Narrow windows in a call | Done | Controls that do not fit move into "..." (View, Reactions, Raise hand, People, Chat; mic, camera, share, "..." and Leave always stay). Below 960 px, or when a side panel would leave the call under 720 px, the chat list hides; still too narrow, the panel overlays the call. Layout guard checks 640x480, 1280x800, 1920x1080 |209
| Narrow windows in a call | Done | Controls that do not fit move into "..." (View, Reactions, Raise hand, People, Chat; mic, camera, share, "..." and Leave always stay). Below 960 px, or when a side panel would leave the call under 720 px, the chat list hides; still too narrow, the panel overlays the call. Layout guard checks 640x480, 1280x800, 1920x1080 |209
| Give and take control | Missing | Protocol known (main-channel data channel, action codes 0-11); needs a second person and a security review |210
| Give and take control | Missing | Protocol known (main-channel data channel, action codes 0-11); needs a second person and a security review |@@ -425,17 +425,15 @@ fn work_day_chips(
425
425
.items_center()
426
426
.justify_center()
427
427
.rounded(px(6.))
428
.border_1()
429
428
.text_size(px(12.))
430
429
.font_weight(FontWeight::SEMIBOLD)
431
430
.map(|chip| {
432
431
if on {
433
chip.bg(theme::accent())
434
.border_color(theme::accent())
435
.text_color(theme::on_accent())
432
chip.bg(theme::accent()).text_color(theme::on_accent())
436
433
} else {
437
chip.border_color(theme::border_strong())
434
chip.bg(theme::surface_raised())
438
435
.text_color(theme::text_soft())
436
.hover(|chip| chip.bg(theme::popup_hover()))
439
437
}
440
438
})
441
439
.when(!last, |chip| {
@@ -425,17 +425,15 @@ fn work_day_chips(425
.items_center()425
.items_center()426
.justify_center()426
.justify_center()427
.rounded(px(6.))427
.rounded(px(6.))428
.border_1()429
.text_size(px(12.))428
.text_size(px(12.))430
.font_weight(FontWeight::SEMIBOLD)429
.font_weight(FontWeight::SEMIBOLD)431
.map(|chip| {430
.map(|chip| {432
if on {431
if on {433
chip.bg(theme::accent())432
chip.bg(theme::accent()).text_color(theme::on_accent())434
.border_color(theme::accent())435
.text_color(theme::on_accent())436
} else {433
} else {437
chip.border_color(theme::border_strong())434
chip.bg(theme::surface_raised())438
.text_color(theme::text_soft())435
.text_color(theme::text_soft())436
.hover(|chip| chip.bg(theme::popup_hover()))439
}437
}440
})438
})441
.when(!last, |chip| {439
.when(!last, |chip| {@@ -171,6 +171,7 @@ fn vertical_line() -> Div {
171
171
div().w(px(1.)).h_full().flex_none().bg(theme::border())
172
172
}
173
173
174
#[allow(clippy::too_many_arguments)]
174
175
pub fn month_grid(
175
176
state: &Entity<AppState>,
176
177
start: NaiveDate,
@@ -171,6 +171,7 @@ fn vertical_line() -> Div {171
div().w(px(1.)).h_full().flex_none().bg(theme::border())171
div().w(px(1.)).h_full().flex_none().bg(theme::border())172
}172
}173
173
174
#[allow(clippy::too_many_arguments)]174
pub fn month_grid(175
pub fn month_grid(175
state: &Entity<AppState>,176
state: &Entity<AppState>,176
start: NaiveDate,177
start: NaiveDate,@@ -46,6 +46,25 @@ pub const CALENDAR_HEADER_TAG: &str = "shell/islands/calendar/header";
46
46
pub const CALENDAR_DAY_HEADERS_TAG: &str = "shell/islands/calendar/day-headers";
47
47
pub const CALENDAR_NEW_MEETING_TAG: &str = "shell/islands/calendar/header/new-meeting";
48
48
pub const COMPACT_HEADER_WIDTH: f32 = 960.;
49
/// Header widths below which button labels give way to icons (German labels are longest).
50
const SECONDARY_LABELS_WIDTH: f32 = 1080.;
51
const PRIMARY_LABELS_WIDTH: f32 = 780.;
52
53
/// Which header buttons keep their text at a given header width.
54
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
55
pub struct HeaderLabels {
56
/// Today, view and New meeting.
57
pub primary: bool,
58
/// Join with an ID and Meet now.
59
pub secondary: bool,
60
}
61
62
pub fn header_labels(header_width: f32) -> HeaderLabels {
63
HeaderLabels {
64
primary: header_width >= PRIMARY_LABELS_WIDTH,
65
secondary: header_width >= SECONDARY_LABELS_WIDTH,
66
}
67
}
49
68
const BUSY_FILL_OPACITY: f32 = 0.28;
50
69
const FREE_FILL_OPACITY: f32 = 0.12;
51
70
const STATUS_BAR_WIDTH: f32 = 4.;
@@ -216,9 +235,11 @@ impl CalendarView {
216
235
dates: &[NaiveDate],
217
236
layout: &WeekLayout,
218
237
compact: bool,
238
labels: HeaderLabels,
219
239
) -> impl IntoElement {
220
240
let span_state = self.state.clone();
221
let label = |key: &'static str| (!compact).then(|| tr(key));
241
let label = |key: &'static str| labels.primary.then(|| tr(key));
242
let secondary = |key: &'static str| labels.secondary.then(|| tr(key));
222
243
let (today, back, forward) = (self.state.clone(), self.state.clone(), self.state.clone());
223
244
let (join_state, meet_state, new_state) =
224
245
(self.state.clone(), self.state.clone(), self.state.clone());
@@ -301,7 +322,7 @@ impl CalendarView {
301
322
.small()
302
323
.ghost()
303
324
.icon(IconName::LayoutGrid)
304
.label(span.label())
325
.when(labels.primary, |button| button.label(span.label()))
305
326
.dropdown_caret(true)
306
327
.dropdown_menu(move |menu, _, _| {
307
328
CalendarSpan::ALL.iter().fold(menu, |menu, &choice| {
@@ -323,7 +344,7 @@ impl CalendarView {
323
344
.small()
324
345
.outline()
325
346
.icon(IconName::Hash)
326
.when_some(label("calendar.view.join_with_id"), |button, text| {
347
.when_some(secondary("calendar.view.join_with_id"), |button, text| {
327
348
button.label(text)
328
349
})
329
350
.tooltip(tr("calendar.view.join_with_id"))
@@ -336,7 +357,7 @@ impl CalendarView {
336
357
.small()
337
358
.outline()
338
359
.icon(IconName::Video)
339
.when_some(label("calendar.view.meet_now"), |button, text| {
360
.when_some(secondary("calendar.view.meet_now"), |button, text| {
340
361
button.label(text)
341
362
})
342
363
.tooltip(tr("calendar.view.meet_now"))
@@ -715,7 +736,7 @@ impl CalendarView {
715
736
div()
716
737
.absolute()
717
738
.top(px(now_top - NOW_DOT_SIZE / 2.))
718
.left(px(-NOW_DOT_SIZE / 2.))
739
.left_0()
719
740
.size(px(NOW_DOT_SIZE))
720
741
.rounded_full()
721
742
.bg(theme::accent()),
@@ -916,7 +937,8 @@ fn source_label(event: &CalendarEvent) -> String {
916
937
917
938
impl Render for CalendarView {
918
939
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
919
let compact = f32::from(window.viewport_size().width) < COMPACT_HEADER_WIDTH;
940
let window_width = f32::from(window.viewport_size().width);
941
let compact = window_width < COMPACT_HEADER_WIDTH;
920
942
self.sync_follow_from_state(window, cx);
921
943
let state = self.state.read(cx);
922
944
let start = state.calendar_start();
@@ -938,6 +960,16 @@ impl Render for CalendarView {
938
960
.collect();
939
961
let work_minutes = state.calendar_prefs.work_hours.minute_range();
940
962
let show_picker = !compact && !state.calendar_prefs.pane_hidden;
963
// Width left for the header: window minus rail, island gaps and the pane.
964
let header_width = window_width
965
- app_ui_kit::layout::RAIL_WIDTH
966
- 2. * app_ui_kit::layout::ISLAND_GAP
967
- if show_picker {
968
calendar_picker::PICKER_WIDTH
969
} else {
970
0.
971
};
972
let labels = header_labels(header_width);
941
973
h_flex()
942
974
.debug_selector(|| "shell/islands/calendar".into())
943
975
.flex_1()
@@ -955,7 +987,7 @@ impl Render for CalendarView {
955
987
.flex_1()
956
988
.min_w_0()
957
989
.h_full()
958
.child(self.header(start, span, &dates, &layout, compact))
990
.child(self.header(start, span, &dates, &layout, compact, labels))
959
991
.children(load_notices(&self.state, &failures, loading))
960
992
.children(meeting_proposal_cards(cx))
961
993
.map(|calendar| {
@@ -990,3 +1022,18 @@ impl Render for CalendarView {
990
1022
)
991
1023
}
992
1024
}
1025
1026
#[cfg(test)]
1027
mod tests {
1028
use super::header_labels;
1029
1030
#[test]
1031
fn header_buttons_drop_their_text_as_the_header_narrows() {
1032
let wide = header_labels(1300.);
1033
assert!(wide.primary && wide.secondary);
1034
let middle = header_labels(900.);
1035
assert!(middle.primary && !middle.secondary);
1036
let narrow = header_labels(600.);
1037
assert!(!narrow.primary && !narrow.secondary);
1038
}
1039
}
@@ -46,6 +46,25 @@ pub const CALENDAR_HEADER_TAG: &str = "shell/islands/calendar/header";46
pub const CALENDAR_DAY_HEADERS_TAG: &str = "shell/islands/calendar/day-headers";46
pub const CALENDAR_DAY_HEADERS_TAG: &str = "shell/islands/calendar/day-headers";47
pub const CALENDAR_NEW_MEETING_TAG: &str = "shell/islands/calendar/header/new-meeting";47
pub const CALENDAR_NEW_MEETING_TAG: &str = "shell/islands/calendar/header/new-meeting";48
pub const COMPACT_HEADER_WIDTH: f32 = 960.;48
pub const COMPACT_HEADER_WIDTH: f32 = 960.;49
/// Header widths below which button labels give way to icons (German labels are longest).50
const SECONDARY_LABELS_WIDTH: f32 = 1080.;51
const PRIMARY_LABELS_WIDTH: f32 = 780.;52
53
/// Which header buttons keep their text at a given header width.54
#[derive(Debug, Clone, Copy, PartialEq, Eq)]55
pub struct HeaderLabels {56
/// Today, view and New meeting.57
pub primary: bool,58
/// Join with an ID and Meet now.59
pub secondary: bool,60
}61
62
pub fn header_labels(header_width: f32) -> HeaderLabels {63
HeaderLabels {64
primary: header_width >= PRIMARY_LABELS_WIDTH,65
secondary: header_width >= SECONDARY_LABELS_WIDTH,66
}67
}49
const BUSY_FILL_OPACITY: f32 = 0.28;68
const BUSY_FILL_OPACITY: f32 = 0.28;50
const FREE_FILL_OPACITY: f32 = 0.12;69
const FREE_FILL_OPACITY: f32 = 0.12;51
const STATUS_BAR_WIDTH: f32 = 4.;70
const STATUS_BAR_WIDTH: f32 = 4.;@@ -216,9 +235,11 @@ impl CalendarView {216
dates: &[NaiveDate],235
dates: &[NaiveDate],217
layout: &WeekLayout,236
layout: &WeekLayout,218
compact: bool,237
compact: bool,238
labels: HeaderLabels,219
) -> impl IntoElement {239
) -> impl IntoElement {220
let span_state = self.state.clone();240
let span_state = self.state.clone();221
let label = |key: &'static str| (!compact).then(|| tr(key));241
let label = |key: &'static str| labels.primary.then(|| tr(key));242
let secondary = |key: &'static str| labels.secondary.then(|| tr(key));222
let (today, back, forward) = (self.state.clone(), self.state.clone(), self.state.clone());243
let (today, back, forward) = (self.state.clone(), self.state.clone(), self.state.clone());223
let (join_state, meet_state, new_state) =244
let (join_state, meet_state, new_state) =224
(self.state.clone(), self.state.clone(), self.state.clone());245
(self.state.clone(), self.state.clone(), self.state.clone());@@ -301,7 +322,7 @@ impl CalendarView {301
.small()322
.small()302
.ghost()323
.ghost()303
.icon(IconName::LayoutGrid)324
.icon(IconName::LayoutGrid)304
.label(span.label())325
.when(labels.primary, |button| button.label(span.label()))305
.dropdown_caret(true)326
.dropdown_caret(true)306
.dropdown_menu(move |menu, _, _| {327
.dropdown_menu(move |menu, _, _| {307
CalendarSpan::ALL.iter().fold(menu, |menu, &choice| {328
CalendarSpan::ALL.iter().fold(menu, |menu, &choice| {@@ -323,7 +344,7 @@ impl CalendarView {323
.small()344
.small()324
.outline()345
.outline()325
.icon(IconName::Hash)346
.icon(IconName::Hash)326
.when_some(label("calendar.view.join_with_id"), |button, text| {347
.when_some(secondary("calendar.view.join_with_id"), |button, text| {327
button.label(text)348
button.label(text)328
})349
})329
.tooltip(tr("calendar.view.join_with_id"))350
.tooltip(tr("calendar.view.join_with_id"))@@ -336,7 +357,7 @@ impl CalendarView {336
.small()357
.small()337
.outline()358
.outline()338
.icon(IconName::Video)359
.icon(IconName::Video)339
.when_some(label("calendar.view.meet_now"), |button, text| {360
.when_some(secondary("calendar.view.meet_now"), |button, text| {340
button.label(text)361
button.label(text)341
})362
})342
.tooltip(tr("calendar.view.meet_now"))363
.tooltip(tr("calendar.view.meet_now"))@@ -715,7 +736,7 @@ impl CalendarView {715
div()736
div()716
.absolute()737
.absolute()717
.top(px(now_top - NOW_DOT_SIZE / 2.))738
.top(px(now_top - NOW_DOT_SIZE / 2.))718
.left(px(-NOW_DOT_SIZE / 2.))739
.left_0()719
.size(px(NOW_DOT_SIZE))740
.size(px(NOW_DOT_SIZE))720
.rounded_full()741
.rounded_full()721
.bg(theme::accent()),742
.bg(theme::accent()),@@ -916,7 +937,8 @@ fn source_label(event: &CalendarEvent) -> String {916
937
917
impl Render for CalendarView {938
impl Render for CalendarView {918
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {939
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {919
let compact = f32::from(window.viewport_size().width) < COMPACT_HEADER_WIDTH;940
let window_width = f32::from(window.viewport_size().width);941
let compact = window_width < COMPACT_HEADER_WIDTH;920
self.sync_follow_from_state(window, cx);942
self.sync_follow_from_state(window, cx);921
let state = self.state.read(cx);943
let state = self.state.read(cx);922
let start = state.calendar_start();944
let start = state.calendar_start();@@ -938,6 +960,16 @@ impl Render for CalendarView {938
.collect();960
.collect();939
let work_minutes = state.calendar_prefs.work_hours.minute_range();961
let work_minutes = state.calendar_prefs.work_hours.minute_range();940
let show_picker = !compact && !state.calendar_prefs.pane_hidden;962
let show_picker = !compact && !state.calendar_prefs.pane_hidden;963
// Width left for the header: window minus rail, island gaps and the pane.964
let header_width = window_width965
- app_ui_kit::layout::RAIL_WIDTH966
- 2. * app_ui_kit::layout::ISLAND_GAP967
- if show_picker {968
calendar_picker::PICKER_WIDTH969
} else {970
0.971
};972
let labels = header_labels(header_width);941
h_flex()973
h_flex()942
.debug_selector(|| "shell/islands/calendar".into())974
.debug_selector(|| "shell/islands/calendar".into())943
.flex_1()975
.flex_1()@@ -955,7 +987,7 @@ impl Render for CalendarView {955
.flex_1()987
.flex_1()956
.min_w_0()988
.min_w_0()957
.h_full()989
.h_full()958
.child(self.header(start, span, &dates, &layout, compact))990
.child(self.header(start, span, &dates, &layout, compact, labels))959
.children(load_notices(&self.state, &failures, loading))991
.children(load_notices(&self.state, &failures, loading))960
.children(meeting_proposal_cards(cx))992
.children(meeting_proposal_cards(cx))961
.map(|calendar| {993
.map(|calendar| {@@ -990,3 +1022,18 @@ impl Render for CalendarView {990
)1022
)991
}1023
}992
}1024
}1025
1026
#[cfg(test)]1027
mod tests {1028
use super::header_labels;1029
1030
#[test]1031
fn header_buttons_drop_their_text_as_the_header_narrows() {1032
let wide = header_labels(1300.);1033
assert!(wide.primary && wide.secondary);1034
let middle = header_labels(900.);1035
assert!(middle.primary && !middle.secondary);1036
let narrow = header_labels(600.);1037
assert!(!narrow.primary && !narrow.secondary);1038
}1039
}