Skip to content

fix: fix optional google sheet sharing#1024

Merged
stevenle merged 1 commit intomainfrom
claude/fix-sheets-sharing-bug-JGLhg
Apr 3, 2026
Merged

fix: fix optional google sheet sharing#1024
stevenle merged 1 commit intomainfrom
claude/fix-sheets-sharing-bug-JGLhg

Conversation

@stevenle
Copy link
Copy Markdown
Member

@stevenle stevenle commented Apr 3, 2026

Summary

This PR makes Google Sheet sharing optional during export and improves error handling when sharing fails. The sharing operation is now wrapped in a try-catch block so that sheet creation succeeds even if sharing encounters an error.

Key Changes

  • Conditional sharing logic: Inverted the share condition to only attempt sharing when explicitly requested, rather than sharing by default
  • Error handling: Wrapped the sharing operation in a try-catch block that logs a warning if sharing fails, allowing the sheet to remain usable
  • UI fix: Changed the share checkbox from a controlled component using checked prop to an uncontrolled component using defaultChecked for proper React patterns

Implementation Details

  • The sharing operation now gracefully degrades — if it fails, users can manually share the sheet later
  • The checkbox state is now properly managed as an uncontrolled component, which is more appropriate for this use case
  • Console warning is logged when sharing fails to help with debugging while not blocking the user's workflow

https://claude.ai/code/session_01Woi52LoFphT663pRrUiNDF

…x toggle

Two bugs fixed:
1. If sharing failed (e.g. Drive API permission error), the entire sheet
   creation was treated as a failure even though the sheet was already
   created. Now sharing errors are caught and logged, allowing the user
   to share manually.
2. The share checkbox used `checked` instead of `defaultChecked`, making
   it uncontrollable — the user's toggle was ignored and the ref always
   returned the initial value.

https://claude.ai/code/session_01Woi52LoFphT663pRrUiNDF
@stevenle stevenle changed the title Make Google Sheet sharing optional and improve error handling fix: fix optional google sheet sharing Apr 3, 2026
@stevenle stevenle merged commit 3b2111c into main Apr 3, 2026
1 check passed
@stevenle stevenle deleted the claude/fix-sheets-sharing-bug-JGLhg branch April 3, 2026 21:40
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.

2 participants