feat: add calendar visibility picker
Derive session calendars from event metadata and apply one visibility contract to month rendering, appointment focus, and search without filtering persistence writes. Add keyboard picker coverage, full-model save regression tests, documentation, warning-clean builds, sanitizer verification, and live PTY terminal restoration checks.
This commit is contained in:
@@ -183,6 +183,34 @@ void test_event_search()
|
||||
"event search does not locale-fold non-ASCII bytes");
|
||||
}
|
||||
|
||||
void test_calendar_visibility()
|
||||
{
|
||||
const std::vector<nocal::Calendar> calendars{
|
||||
{.id = "", .name = "Default", .color = {}, .visible = true,
|
||||
.read_only = false},
|
||||
{.id = "personal", .name = "Personal", .color = {}, .visible = true,
|
||||
.read_only = false},
|
||||
{.id = "work", .name = "Work", .color = {}, .visible = false,
|
||||
.read_only = false},
|
||||
};
|
||||
nocal::Event default_event;
|
||||
nocal::Event personal_event;
|
||||
personal_event.calendar_id = "personal";
|
||||
nocal::Event work_event;
|
||||
work_event.calendar_id = "work";
|
||||
nocal::Event new_event;
|
||||
new_event.calendar_id = "new-calendar";
|
||||
|
||||
check(nocal::event_is_visible(default_event, calendars),
|
||||
"an empty calendar ID uses the visible default calendar");
|
||||
check(nocal::event_is_visible(personal_event, calendars),
|
||||
"an explicitly visible calendar exposes its events");
|
||||
check(!nocal::event_is_visible(work_event, calendars),
|
||||
"a hidden calendar filters its events");
|
||||
check(nocal::event_is_visible(new_event, calendars),
|
||||
"unknown calendar metadata defaults visible instead of hiding data");
|
||||
}
|
||||
|
||||
void test_daily_dst_recurrence()
|
||||
{
|
||||
using namespace std::chrono;
|
||||
@@ -407,6 +435,7 @@ int main()
|
||||
test_month_layout();
|
||||
test_event_queries();
|
||||
test_event_search();
|
||||
test_calendar_visibility();
|
||||
test_daily_dst_recurrence();
|
||||
test_floating_dst_and_until();
|
||||
test_weekly_count_and_exdates();
|
||||
|
||||
Reference in New Issue
Block a user