Skip to content

feat: add ooo-chat-app and schedule-meetings#387

Merged
PierrickVoulet merged 1 commit intogoogleworkspace:mainfrom
PierrickVoulet:add-chat-apps
Dec 11, 2025
Merged

feat: add ooo-chat-app and schedule-meetings#387
PierrickVoulet merged 1 commit intogoogleworkspace:mainfrom
PierrickVoulet:add-chat-apps

Conversation

@PierrickVoulet
Copy link
Contributor

No description provided.

@PierrickVoulet PierrickVoulet self-assigned this Dec 11, 2025
@product-auto-label product-auto-label bot added the javascript Pull requests that update Javascript code label Dec 11, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @PierrickVoulet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the functionality of Google Chat by adding two new applications. The first app streamlines out-of-office management, allowing users to automate common OOO tasks like calendar blocking and auto-replies. The second app simplifies meeting scheduling, providing an intuitive interface to create calendar events directly from chat conversations. These additions enhance productivity by bringing essential calendar and email management tools into the chat environment.

Highlights

  • New OOO Chat App: Introduced a new Google Chat application designed to help users manage their out-of-office tasks directly from Chat. This includes functionality to block out calendar days, cancel all meetings for a day, and set an automatic Gmail out-of-office reply.
  • New Schedule Meetings Chat App: Added a new Google Chat application that allows users to quickly schedule meetings. It features an interactive dialog for inputting meeting details like invitees, subject, description, and duration, with built-in form validation and Google Calendar integration.
  • Google Workspace Integration: Both new applications leverage Google Apps Script to integrate with Google Calendar and Gmail, enabling seamless automation of OOO and meeting scheduling workflows within the Google Workspace ecosystem.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@PierrickVoulet PierrickVoulet merged commit 2a2c81b into googleworkspace:main Dec 11, 2025
4 of 7 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two new Google Chat apps: ooo-chat-app and schedule-meetings. The implementation is a good starting point, but I've identified several high-severity issues that need to be addressed. These include a significant correctness bug in meeting cancellation logic, use of magic numbers, a UI formatting bug due to a typo, use of a deprecated API field, and some dead code that could be misleading. Please see the detailed comments for suggestions on how to fix these issues.

Comment on lines +49 to +58
switch (message.slashCommand.commandId) {
case 1: // Help command
return createHelpCard();
case 2: // Block out day command
return blockDayOut();
case 3: // Cancel all meetings command
return cancelAllMeetings();
case 4: // Set auto reply command
return setAutoReply();
}

Choose a reason for hiding this comment

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

high

The switch statement uses magic numbers (1, 2, 3, 4) for commandId. This makes the code harder to read, maintain, and debug. It's better to define these as named constants.

For example, you could define an object for the commands at the top of the file:

const SLASH_COMMANDS = {
  HELP: 1,
  BLOCK_DAY_OUT: 2,
  CANCEL_MEETINGS: 3,
  SET_AUTO_REPLY: 4,
};

And then use SLASH_COMMANDS.HELP, etc. in your switch statement. This pattern is already used in the schedule-meetings app and should be applied here for consistency and clarity.

Comment on lines +181 to +189
function cancelMeetings() {
const events = CalendarApp.getEventsForDay(new Date());

for (const event of events) {
if (event.getGuestList().length > 0) {
event.setMyStatus(CalendarApp.GuestStatus.NO);
}
}
}

Choose a reason for hiding this comment

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

high

The function cancelMeetings is misleading. It only declines the user's attendance (setMyStatus(CalendarApp.GuestStatus.NO)), even for meetings they organize. This will not 'cancel' the meeting for other attendees; it will just show the organizer as not attending, which can be confusing.

To correctly 'cancel' a meeting the user owns, you should delete the event. For meetings where they are just an attendee, declining is the correct action. I suggest checking if the user is the event owner.

function cancelMeetings() {
  const events = CalendarApp.getEventsForDay(new Date());

  for (const event of events) {
    if (event.getGuestList().length > 0) {
      if (event.isOwnedByMe()) {
        // If the user is the organizer, cancel the event for everyone.
        event.deleteEvent();
      } else {
        // If the user is an attendee, just decline the invitation.
        event.setMyStatus(CalendarApp.GuestStatus.NO);
      }
    }
  }
}

}

// Lets users know what they can do and how they can get help.
message = `${message}/nI can quickly schedule a meeting for you with just a few clicks.Try me out by typing */schedule_Meeting*. /nTo learn what else I can do, type */help*.`;

Choose a reason for hiding this comment

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

high

There's a typo in the welcome message. You're using /n for newlines, which will be rendered literally in the chat message. To create a newline, you should use \n.

Suggested change
message = `${message}/nI can quickly schedule a meeting for you with just a few clicks.Try me out by typing */schedule_Meeting*. /nTo learn what else I can do, type */help*.`;
message = `${message}\nI can quickly schedule a meeting for you with just a few clicks.Try me out by typing */schedule_Meeting*. \nTo learn what else I can do, type */help*.`;

Comment on lines +162 to +164
dialog_action: {
actionStatus: "OK",
},

Choose a reason for hiding this comment

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

high

The dialog_action field is deprecated. You should use dialogAction instead to ensure future compatibility. The rest of the code in Dialog.js already uses the correct dialogAction field, so this change will also make the code consistent.

Suggested change
dialog_action: {
actionStatus: "OK",
},
dialogAction: {
actionStatus: "OK",
},

const [month, day, year] = parts[0].split("/").map(Number);
const [hour, minute] = parts[1].split(":").map(Number);

Session.getScriptTimeZone();

Choose a reason for hiding this comment

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

high

This call to Session.getScriptTimeZone() has no effect as its return value is not used. This is dead code and can be safely removed. The script's timezone is already correctly handled when creating the Date object and formatting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant