Skip to content

feat: edit an existing form #25

@ummaraali2

Description

@ummaraali2

Problem

Currently Form Builder is create-only. Once a form is
generated, the only way to edit it is to go directly
to Google Forms. There is no way to open an existing
form in Form Builder, make changes, and update it.

Expected behavior

  1. User clicks "Open Form" button in the header
  2. Google Drive Picker opens showing ONLY Google Forms
  3. User selects any of their existing Google Forms
  4. Form Builder fetches the form content via Google
    Forms API
  5. Title, description, settings and all questions
    load into the editor and preview
  6. User edits questions in the preview panel
  7. User clicks Generate Form to create a new updated
    copy

UI

Add "Open Form" button in the header between
"Start Over" and "Generate Form".

On click → Google Drive Picker opens showing only
Google Forms files (no other Drive files shown).

Implementation

Use Google Picker API:

  • Load: <script src="https://apis.google.com/js/api.js">
  • Filter picker to mimeType =
    application/vnd.google-apps.form only
  • On file selected, call:
    GET https://forms.googleapis.com/v1/forms/{formId}
  • Parse response into S.questions
  • Populate title, description, settings
  • Call renderPreview() and sync()

OAuth scope required — IMPORTANT

This feature requires a new OAuth scope:

drive.readonly
"See and download all your Google Drive files"

Why this is needed:

  • Current scope drive.file only allows access to
    files created by Form Builder
  • drive.readonly allows access to ALL forms in the
    user's Drive including ones created directly in
    Google Forms
  • Without drive.readonly, the picker will only show
    forms previously created via Form Builder which
    defeats the purpose

Impact:

  • drive.readonly is a sensitive scope
  • Requires additional Google OAuth verification
  • Users will see this permission listed on the
    consent screen
  • Must be justified to Google during verification:
    "Used to allow users to browse and open their
    existing Google Forms for editing in Form Builder"

Edge cases

  • No forms in Drive → show empty state in picker
  • Form has unsupported question types → skip with
    warning toast
  • Large forms (100+ questions) → warn user before
    loading
  • User opens a form → makes edits → generates new
    form → original form is untouched

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions