Skip to content

Feat/gdrive#23

Merged
viseshrp merged 19 commits intomainfrom
feat/gdrive
Feb 21, 2026
Merged

Feat/gdrive#23
viseshrp merged 19 commits intomainfrom
feat/gdrive

Conversation

@viseshrp
Copy link
Owner

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @viseshrp, 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 enhances the nufftabs Chrome extension by adding an optional Google Drive backup and restore capability. This feature provides users with a robust way to manually save and retrieve their saved tab groups and settings, improving data persistence and offering greater control over their data. The changes involve new UI components, backend logic for interacting with the Google Drive API, and thorough updates to documentation and testing to support this new functionality.

Highlights

  • Google Drive Backup/Restore Feature: Introduced an optional, user-initiated Google Drive backup and restore feature, allowing users to save and retrieve their tab groups and settings to their personal Drive account.
  • Updated Privacy Policy and Documentation: The PRIVACY_POLICY.md and README.md have been updated to reflect the new Google Drive integration, detailing data handling, network access, and required permissions. New detailed documentation (DRIVE_BACKUP_PLAN.md, DRIVE_BACKUP_SPEC.md) and architecture updates (architecture.md, storage.md) were added.
  • New UI and Modules for Drive Integration: A new dedicated authentication page (entrypoints/drive-auth/) and core Drive modules (entrypoints/drive/) have been added. The options page UI (entrypoints/options/) now includes controls for connecting to Google Drive, performing backups, setting retention, and restoring from backups.
  • Permissions and Configuration Updates: The extension's manifest (wxt.config.ts) has been updated to include identity permission and https://www.googleapis.com/ host permission, along with OAuth2 client details, necessary for Google Drive API interaction.
  • Comprehensive Testing: New unit tests (drive_api.test.ts, drive_auth.test.ts, drive_backup_utils.test.ts) and integration tests (drive_backup.test.ts) have been added to ensure the reliability and correctness of the Google Drive functionality.
Changelog
  • PRIVACY_POLICY.md
    • Updated summary to mention optional Google Drive backup feature.
    • Added details on optional Google Drive backup metadata processed.
    • Included how data is used for Drive backup actions.
    • Expanded storage and retention section to cover Drive backups.
    • Updated network access section to detail requests made for Drive backup/restore.
  • README.md
    • Added 'Optional manual Google Drive backup/restore from the options page' to features list.
    • Updated permissions section to include tabs, storage, and identity.
    • Added host permissions for https://www.googleapis.com/ for Drive backup/restore.
    • Added a new section 'Google Drive manual backup (optional)' with step-by-step instructions.
    • Expanded 'Project structure' to include new entrypoints/drive/ and entrypoints/drive-auth/ modules.
    • Updated 'Permissions' section to detail identity and https://www.googleapis.com/ host permissions.
  • TESTING.md
    • Added new unit test files: drive_api.test.ts, drive_auth.test.ts, drive_backup_utils.test.ts.
    • Added new integration test file: drive_backup.test.ts.
    • Updated 'Test coverage' section to include manual Drive backup/restore behavior.
    • Updated coverage exclusion to include entrypoints/drive-auth/index.ts and entrypoints/drive-auth/drive_auth_page.ts.
  • docs/DRIVE_BACKUP_PLAN.md
    • Added a new document detailing the implementation plan for Google Drive manual backup.
  • docs/DRIVE_BACKUP_SPEC.md
    • Added a new document specifying the Drive Backup feature, covering user behavior, permissions, data model, and test coverage.
  • docs/architecture.md
    • Added 'Drive backup modules' to the 'High-level architecture' section.
    • Expanded 'Data flow summary' to include 'Optional Drive backup from options' flow.
    • Added 'Drive backup/auth issues' to the 'Troubleshooting matrix'.
  • docs/storage.md
    • Added 'Optional Drive backup metadata' section, detailing driveInstallId, driveBackupIndex, and driveRetentionCount.
  • entrypoints/drive-auth/drive_auth_page.ts
    • Added new file implementing the logic for the Google Drive authentication page, handling connect/disconnect and status display.
  • entrypoints/drive-auth/index.html
    • Added new file defining the HTML structure for the Google Drive authentication page.
  • entrypoints/drive-auth/index.ts
    • Added new file as the entrypoint for the Drive authentication page, initializing its logic.
  • entrypoints/drive-auth/style.css
    • Added new file containing CSS styles for the Google Drive authentication page.
  • entrypoints/drive/auth.ts
    • Added new file providing Promise-based wrappers for chrome.identity API calls, including getAuthToken, removeCachedAuthToken, and revokeToken.
  • entrypoints/drive/drive_api.ts
    • Added new file implementing a minimal Google Drive REST client for file operations like listing, creating folders, uploading, downloading, and deleting files.
  • entrypoints/drive/drive_backup.ts
    • Added new file containing the core logic for Drive backup orchestration, including serialization, upload/list/retention workflows, and local backup index caching.
  • entrypoints/drive/types.ts
    • Added new file defining shared types and constants for the Drive backup feature, such as DriveBackupEntry, DriveBackupIndex, and SerializedBackupPayload.
  • entrypoints/options/index.html
    • Added a new <section> for 'Google Drive backup' controls, including buttons for connect/backup, retention input, and a backup list table.
  • entrypoints/options/settings_page.ts
    • Imported Drive-related modules and functions.
    • Added helper functions formatBackupTimestamp, formatBytes, and renderDriveBackups for UI display.
    • Implemented initDriveBackupSection to initialize the Drive backup UI, handle authentication, backup/restore actions, and retention settings.
    • Integrated initDriveBackupSection call into initSettingsPage.
  • entrypoints/options/style.css
    • Added new CSS styles for the .drive-backup section, including controls, list table, and status display.
  • tests/helpers/mock_chrome.ts
    • Added lastError property to chrome.runtime mock.
    • Added identity API mock with getAuthToken and removeCachedAuthToken methods.
    • Initialized cachedAuthToken in mock Chrome creation.
    • Implemented logic for getAuthToken to simulate interactive and non-interactive authentication.
    • Implemented logic for removeCachedAuthToken to clear the cached token.
  • tests/integration/drive_backup.test.ts
    • Added new integration tests for the Drive backup feature, covering scenarios like successful backup, fallback rendering, and error handling during auth and retention.
  • tests/unit/drive_api.test.ts
    • Added new unit tests for drive_api.ts functions, covering file listing, folder creation, JSON upload/download, and file deletion, including error handling.
  • tests/unit/drive_auth.test.ts
    • Added new unit tests for auth.ts functions, covering identity API availability, token retrieval (interactive/silent), token caching, and revocation.
  • tests/unit/drive_backup_utils.test.ts
    • Added new unit tests for drive_backup.ts utility functions, covering install ID management, backup serialization, retention logic, local index read/write, and restore operations.
  • vitest.config.ts
    • Updated coverage.exclude to include entrypoints/drive-auth/index.ts and entrypoints/drive-auth/drive_auth_page.ts.
  • wxt.config.ts
    • Added extensionKey constant.
    • Added key to manifest configuration.
    • Added identity to permissions.
    • Added https://www.googleapis.com/ to host_permissions.
    • Added oauth2 configuration with client_id and scopes for Google Drive.
Activity
  • The pull request introduces a major new feature: Google Drive backup and restore.
  • The author viseshrp has implemented all aspects of this feature, from core logic to UI and documentation.
  • Extensive new files have been added for Drive-specific functionality, including API wrappers, backup orchestration, and a dedicated authentication page.
  • Existing core files like PRIVACY_POLICY.md, README.md, and entrypoints/options/ have been updated to integrate and document the new feature.
  • A comprehensive suite of new unit and integration tests has been developed to ensure the reliability of the Drive backup system.
  • Configuration files have been adjusted to accommodate new permissions and OAuth settings required for Google Drive integration.
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.

Copy link
Contributor

@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 is an impressive and substantial feature addition that brings Google Drive backup functionality to the extension. The implementation is well-structured, with clear separation of concerns into dedicated modules for authentication, API interaction, and backup orchestration. The code is robust, with good error handling and normalization of data. The addition of comprehensive unit and integration tests is excellent and ensures the feature is reliable. I've included a couple of suggestions, one for improving the documentation and a more critical one to address a potential bug in the Drive file listing logic related to pagination.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 95.69161% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.3%. Comparing base (2c8bb5f) to head (7741022).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
entrypoints/options/settings_page.ts 95.2% 13 Missing and 3 partials ⚠️
entrypoints/drive/drive_backup.ts 93.4% 15 Missing ⚠️
entrypoints/drive/auth.ts 89.3% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main     #23     +/-   ##
=======================================
+ Coverage   94.9%   95.3%   +0.4%     
=======================================
  Files         11      16      +5     
  Lines       1022    1903    +881     
  Branches     273     473    +200     
=======================================
+ Hits         970    1814    +844     
- Misses        42      75     +33     
- Partials      10      14      +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@viseshrp viseshrp merged commit 4c5b040 into main Feb 21, 2026
5 checks passed
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