Skip to content

Add optional event locations to menu - #930

Open
andrewginns wants to merge 6 commits into
leits:masterfrom
andrewginns:codex/add-event-locations
Open

Add optional event locations to menu#930
andrewginns wants to merge 6 commits into
leits:masterfrom
andrewginns:codex/add-event-locations

Conversation

@andrewginns

@andrewginns andrewginns commented Jun 15, 2026

Copy link
Copy Markdown

Status

READY

Description

Adds a new menu option, enabled by default, to show an event's room or location under the event title in the status menu.

This keeps room names visible for in-person meetings, while hiding locations that are only meeting links so the menu does not get cluttered with Zoom, Teams, or similar URLs. If a location includes both a room and a link, it is still shown. The full original location remains available in the event details menu.

The second line is also kept aligned with the event title across the existing time display options.

Checklist

Steps to Test or Reproduce

  1. Build and launch MeetingBar.
  2. Open Appearance preferences and check that the new menu location option is available and enabled by default.
  3. Use an event with a room location such as Room A; open the status menu and check that the room appears under the event title.
  4. Use an event whose location is only a meeting link; check that the link is not shown in the compact menu row.
  5. Use an event with both a room and a link; check that the location is still shown.
  6. Turn the new location option off and check that the status menu no longer shows the second line.
  7. Check the row layout with all-day events, 12-hour time, and hidden end time.

Validation run here:

  • Checked the diff formatting.
  • GitHub checks passed, including Tests, SwiftLint, and Codecov.
  • Could not run the macOS test suite locally because this Windows machine does not have Xcode.

Summary by CodeRabbit

  • New Features

    • Event locations now display in the menu.
    • New preference toggle to show or hide event locations in appearance settings.
    • Meeting link URLs are intelligently filtered from location display.
  • Localization

    • Event location preference label added in 24+ languages.
  • Tests

    • Added comprehensive test coverage for location display and formatting.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 261c1cc2-772c-4fcd-b0cd-2fc053426207

📥 Commits

Reviewing files that changed from the base of the PR and between 948effc and 7fd6101.

📒 Files selected for processing (2)
  • MeetingBar/Core/Models/MBEvent+Helpers.swift
  • MeetingBarTests/HelpersTests.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • MeetingBarTests/HelpersTests.swift
  • MeetingBar/Core/Models/MBEvent+Helpers.swift

Walkthrough

Adds a toggleable event-location feature to MeetingBar: a new displayLocation computed property on MBEvent filters URL-only strings; a showEventLocation defaults key and preferences toggle control visibility; MenuBuilder renders the location as a styled secondary line under each menu item title; all 25 locale files receive the new string.

Changes

Show Event Location in Menu

Layer / File(s) Summary
displayLocation model + preference key + UI toggle + reactive wiring
MeetingBar/Core/Models/MBEvent+Helpers.swift, MeetingBar/Extensions/DefaultsKeys.swift, MeetingBar/UI/Views/Preferences/AppearanceTab.swift, MeetingBar/UI/StatusBar/StatusBarItemController.swift, CHANGELOG.md, MeetingBar/UI/Views/Changelog/Changelog.swift
MBEvent gains a displayLocation computed property that normalizes whitespace and returns nil for URL-only strings. A showEventLocation boolean defaults key (default true) is added, a toggle is rendered in the Preferences Appearance tab, secondaryFontSize is introduced in MenuStyleConstants, and the status-bar publisher subscribes to the new key to trigger updateTitle()/updateMenu().
MenuBuilder location rendering and helpers
MeetingBar/UI/StatusBar/MenuBuilder.swift
makeEventItem is refactored to separate itemTitlePrefix from eventTitle and compute itemLocation via a new helper. A shouldShowLocationAsInactive flag is set across declined, canceled, pending, tentative, personal, and past-event styling branches. New private helpers eventItemLocation, eventItemAttributedTitle, appendLocation, eventTitleIndent, nextDefaultTabStop, and width centralize location rendering with tab-stop alignment and inactive coloring.
Localization strings (25 locales)
MeetingBar/Resources/Localization/*.lproj/Localizable.strings
Adds preferences_appearance_menu_show_event_location_value to all 25 supported locale files (bg, cs, de, en, enm, es, fr, he, hr, hu, it, ja, ko, nb-NO, nl, pl, pt-BR, pt, sk, ta, tr, uk, zh-Hans).
Tests: displayLocation, MenuBuilder location, FakeEvent helper
MeetingBarTests/Helpers/FakeEvent.swift, MeetingBarTests/HelpersTests.swift, MeetingBarTests/StatusBarItem/MenuBuilderTests.swift
makeFakeEvent gains a location parameter. HelpersTests covers nil/whitespace, normalization, URL-only, mixed, and hostless-URI cases for displayLocation. MenuBuilderTests adds cases for show/hide toggle, URL-only in detailed mode, formatting non-inheritance (underline, bold, color), truncation, and glyph-level alignment for all-day, am_pm, and hidden-end-time scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

size:M, lgtm

Suggested reviewers

  • leits
  • mskopp

Poem

🐰 Hop hop! The menu now speaks of place,
A location line with style and grace.
URL-only? Filtered away!
Physical spots get their moment to say.
Twenty-five tongues all know the word—
The rabbit's new feature has been heard! 🗺️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add optional event locations to menu' accurately describes the main change: introducing a new feature to display event locations in the menu.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread MeetingBarTests/StatusBarItem/MenuBuilderTests.swift Fixed
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.05882% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.00%. Comparing base (69bf18d) to head (7fd6101).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
MeetingBar/UI/StatusBar/MenuBuilder.swift 85.86% 11 Missing and 2 partials ⚠️
...etingBarTests/StatusBarItem/MenuBuilderTests.swift 94.26% 9 Missing ⚠️
...eetingBar/UI/Views/Preferences/AppearanceTab.swift 0.00% 4 Missing ⚠️
MeetingBar/UI/Views/Changelog/Changelog.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #930      +/-   ##
==========================================
+ Coverage   36.26%   40.00%   +3.73%     
==========================================
  Files          48       48              
  Lines        5129     5460     +331     
  Branches     1743     1768      +25     
==========================================
+ Hits         1860     2184     +324     
- Misses       3213     3221       +8     
+ Partials       56       55       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@andrewginns
andrewginns force-pushed the codex/add-event-locations branch from 9d05d22 to 0aa3e35 Compare June 15, 2026 23:26
@andrewginns andrewginns changed the title [codex] Add optional event locations to menu Add optional event locations to menu Jun 15, 2026
@andrewginns
andrewginns marked this pull request as ready for review June 15, 2026 23:53
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. feature New feature or request labels Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 948effc9a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread MeetingBar/Core/Models/MBEvent+Helpers.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants