Skip to content

Plug 21 handle menu item visibility for non authenticated users google docs plugin#6

Open
Almoizs-1310 wants to merge 2 commits intoPLUG-1-improve-the-navigation-ans-diagram-selection-ui-for-google-doc-pluginfrom
PLUG-21-handle-menu-item-visibility-for-non-authenticated-users-google-docs-plugin
Open

Plug 21 handle menu item visibility for non authenticated users google docs plugin#6
Almoizs-1310 wants to merge 2 commits intoPLUG-1-improve-the-navigation-ans-diagram-selection-ui-for-google-doc-pluginfrom
PLUG-21-handle-menu-item-visibility-for-non-authenticated-users-google-docs-plugin

Conversation

@Almoizs-1310
Copy link
Copy Markdown

This pull request introduces improvements to the Google Docs add-on by making the menu dynamically reflect the user's authorization state, refactoring menu construction, and updating the About dialog. The changes ensure that menu options are only available to authorized users and that the menu updates automatically after key authentication events.

Menu behavior and authorization:

  • Refactored menu construction into a new buildMenu function in src/server/ui.js, which checks authorization status and only displays options for creating, browsing, and editing diagrams to authorized users.
  • Added a new refreshMenu function to src/server/ui.js and exported it in src/server/index.ts, allowing the menu to be programmatically refreshed after authentication changes. [1] [2] [3]
  • Updated the authentication hook in src/client/hooks/useAuth.ts to call serverFunctions.refreshMenu() after fetching authorization state and after OAuth reset, ensuring the menu updates promptly for the user. [1] [2]
  • Modified the OAuth callback handler in src/server/ui.js to refresh the menu upon successful authorization.

Dialog and UI updates:

  • Updated the About dialog in src/server/ui.js to display new branding and product information for "Mermaid for Google Docs".

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
google-plugin Error Error Mar 5, 2026 9:57am

Request Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant