Skip to content

fix: update dropdown option structure and improve Google Sheets range…#65

Merged
TejaBudumuru3 merged 1 commit into
mainfrom
userroute-updated
Jan 31, 2026
Merged

fix: update dropdown option structure and improve Google Sheets range…#65
TejaBudumuru3 merged 1 commit into
mainfrom
userroute-updated

Conversation

@TejaBudumuru3

@TejaBudumuru3 TejaBudumuru3 commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

… handling

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Updated Google Sheets integration to consistently use sheet names as identifiers across operations.
    • Fixed range formatting in read operations to properly include sheet name prefixes for accurate data retrieval.
    • Adjusted dropdown configuration options to use consistent identifier keys.
  • Chores

    • Added debugging statements to assist with troubleshooting configuration interactions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 31, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR refactors Google Sheets integration identifiers across the stack. Tab identification shifts from tab.id to tab.name in API responses. Configuration dropdown options rename the identifier property from value to id. Type definitions and executor logic are updated accordingly, with debug logging added to UI components.

Changes

Cohort / File(s) Summary
Google Sheets Type Definitions
apps/web/app/lib/types/node.types.ts
Updated ConfigField.options structure to use id key instead of value key for option identifiers, changing the expected shape from { label, value } to { label, id }.
Google Sheets API Layer
apps/web/app/lib/api.ts
Changed tab identifier in google.getSheets from tab.id to tab.name, altering the returned data shape without modifying function signatures.
Google Sheets Node Configuration
apps/web/app/lib/nodeConfigs/googleSheet.action.ts
Updated operation dropdown options to use id key instead of value key for Read Rows, Append Row, and Update Row operations.
Google Sheets Executor
packages/nodes/src/google-sheets/google-sheets.executor.ts
Modified executeReadRows to prefix range parameter with sheet name: ${context.config.sheetName}!${context.config.range}.
Configuration UI
apps/web/app/workflows/[id]/components/ConfigModal.tsx
Added console.log statements for debugging dropdown field onChange handler and options array during render.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Vamsi-o

Poem

🐰 From tab.id to tab.name we hop,
Options dance from value to id without stop,
Ranges now whisper their sheet-mate's name,
Console logs giggle—debugging's our game! ✨
A refactor so sprightly, the sheets shine bright,

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: updating dropdown option structure (from 'value' to 'id' keys) and improving Google Sheets range handling (prefixing with sheet name).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch userroute-updated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/nodes/src/google-sheets/google-sheets.executor.ts (1)

203-208: ⚠️ Potential issue | 🟡 Minor

Add validation for sheetName before constructing the range.

If context.config.sheetName is undefined or empty, the range will become undefined!${range} or !${range}, causing the Google Sheets API to fail with a cryptic error. Consider validating that sheetName exists before constructing the range string.

🛡️ Proposed fix
 async executeReadRows(sheetsService: GoogleSheetsService, context: NodeExecutionContext): Promise<NodeExecutionResult> {
     try{
+        if (!context.config.sheetName) {
+            return {
+                success: false,
+                error: 'Sheet name is required for reading rows'
+            };
+        }
         const rows = await sheetsService.readRows({
             spreadsheetId: context.config.spreadsheetId,
             range: `${context.config.sheetName}!${context.config.range}`
         });
apps/web/app/lib/nodeConfigs/googleSheet.action.ts (1)

40-48: ⚠️ Potential issue | 🟠 Major

Operations append_row and update_row are not implemented in the executor.

The dropdown offers three operations, but the executor (in google-sheets.executor.ts lines 143-152) only handles read_rows. Selecting "Append Row" or "Update Row" will result in an "unknown operation" error at runtime.

Consider either removing these options until implemented, or marking them as disabled/coming soon.

🐛 Option 1: Remove unimplemented options for now
     options: [
       { label: "Read Rows", id: "read_rows" },
-      { label: "Append Row", id: "append_row" },
-      { label: "Update Row", id: "update_row" }
     ],
💡 Option 2: Mark as coming soon in labels
     options: [
       { label: "Read Rows", id: "read_rows" },
-      { label: "Append Row", id: "append_row" },
-      { label: "Update Row", id: "update_row" }
+      { label: "Append Row (Coming Soon)", id: "append_row" },
+      { label: "Update Row (Coming Soon)", id: "update_row" }
     ],
apps/web/app/workflows/[id]/components/ConfigModal.tsx (1)

175-179: ⚠️ Potential issue | 🟡 Minor

Operator precedence issue in option value logic.

The expression opt.value || opt.id !== undefined ? opt.id : opt has unexpected behavior due to operator precedence. The ternary operator ? : has lower precedence than ||, so it evaluates as:

(opt.value || opt.id !== undefined) ? opt.id : opt

This means even when opt.value is truthy, the result is opt.id, not opt.value. If the intent is to prefer opt.value over opt.id, add parentheses:

🐛 Proposed fix
-            {options.map((opt: any) => (
-              <option key={opt.value || opt.id || opt} value={opt.value || opt.id !== undefined ? opt.id : opt }>
+            {options.map((opt: any) => (
+              <option key={opt.id ?? opt.value ?? opt} value={opt.id ?? opt.value ?? opt}>
                 {opt.label || opt.name || opt}
               </option>
             ))}
🤖 Fix all issues with AI agents
In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx:
- Around line 167-173: Remove the two debug console.log calls introduced in the
ConfigModal component: delete the console.log("log for options: ", fieldValue)
inside the select onChange handler (where handleFieldChange is invoked) and
remove the JSX expression {console.log(options)} that runs during render; ensure
no other stray console.log statements remain in the component (particularly
around handleFieldChange, fieldValue, and options usage).

Comment on lines +167 to +173
console.log("log for options: ",fieldValue)
await handleFieldChange(field.name, e.target.value, nodeConfig);
}}
className="w-full p-3 border border-gray-900 bg-black text-white rounded-md"
required={field.required}
>
{console.log(options)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove debug console.log statements before merging.

These debug logging statements should be removed:

  • Line 167: logs fieldValue on every dropdown change
  • Line 173: {console.log(options)} inside JSX renders on every component render and returns undefined

The console.log inside JSX (line 173) is particularly problematic as it executes on every render cycle, not just during development interaction.

🧹 Remove debug logs
           <select
             value={fieldValue}
             onChange={async(e) => {
-              console.log("log for options: ",fieldValue)
               await handleFieldChange(field.name, e.target.value, nodeConfig);
             }}
             className="w-full p-3 border border-gray-900 bg-black text-white rounded-md"
             required={field.required}
           >
-            {console.log(options)}
             <option value="">Select {field.label.toLowerCase()}</option>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log("log for options: ",fieldValue)
await handleFieldChange(field.name, e.target.value, nodeConfig);
}}
className="w-full p-3 border border-gray-900 bg-black text-white rounded-md"
required={field.required}
>
{console.log(options)}
await handleFieldChange(field.name, e.target.value, nodeConfig);
}}
className="w-full p-3 border border-gray-900 bg-black text-white rounded-md"
required={field.required}
>
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx around lines 167 -
173, Remove the two debug console.log calls introduced in the ConfigModal
component: delete the console.log("log for options: ", fieldValue) inside the
select onChange handler (where handleFieldChange is invoked) and remove the JSX
expression {console.log(options)} that runs during render; ensure no other stray
console.log statements remain in the component (particularly around
handleFieldChange, fieldValue, and options usage).

@TejaBudumuru3
TejaBudumuru3 merged commit aa24184 into main Jan 31, 2026
2 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.

2 participants