Skip to content

Conversation

@aarondr77
Copy link
Member

@aarondr77 aarondr77 commented Oct 6, 2025

Description

  • When you reopen the rule form, it should open the google drive form option with the url included.

Testing

Please provide a list of the ways you can "access" or use the functionality. Please try and be exhaustive here, and make sure that you test everything you list.

  • I have tested this on real data that is reasonable and large
  • If I changed the interaction with JupyterLab, I tested that it does not break other programs (like VS Code), and tested that it works "multiple times" in the same notebook.

Documentation

Note if any new documentation needs to addressed or reviewed.


Note

Introduce Google Docs-backed rules with metadata, server/client endpoints to fetch/refresh content, UI to create/edit and validate links, plus startup auto-refresh and tests.

  • Backend:
    • Google Drive integration: Add GoogleDriveService to fetch Google Docs text via export API.
    • Rules metadata: Store in rules/metadata.json; add set_rule_with_metadata, get_rule_metadata, load/save helpers, and refresh_google_drive_rules to sync all google_doc rules.
    • API updates (rules/handlers.py):
      • GET /rules/:key now returns content plus rule_type, google_drive_url, last_updated (when available).
      • PUT /rules/:key accepts content, rule_type, google_drive_url and persists metadata.
      • POST /rules supports action=fetch_google_drive_content and action=refresh_google_drive_rules.
  • Frontend:
    • REST API: Extend setRule, getRule; add fetchGoogleDriveContent, refreshGoogleDriveRules.
    • ContextManager: Auto-refresh Google Drive rules on startup.
    • Rules UI: RulesForm adds source toggle (manual/google_doc), Google Docs URL input with validation, fetch preview, improved loading states, and shows last updated; RulesPage loads/saves rule metadata and supports Google Docs-backed rules.
  • Tests:
    • Add RulesForm tests covering rendering, source switching, URL validation, and loading states.
  • Styles:
    • Enhance RulesForm.css for inputs, Google Docs section, buttons, and loading indicators.

Written by Cursor Bugbot for commit b816676. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Oct 6, 2025

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

Project Deployment Preview Comments Updated (UTC)
monorepo Ready Ready Preview Comment Oct 6, 2025 8:54pm

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

<p className="rule-validation-error">Please enter a valid Google Docs URL</p>
)}
</div>
)}
Copy link

Choose a reason for hiding this comment

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

Bug: CSS Class Name Mismatch Causes Styling Failure

The Google Docs section's styling isn't applied because its className in RulesForm.tsx (google_doc-section) uses an underscore, which doesn't match the hyphenated CSS selector (.google-docs-section) in RulesForm.css.

Additional Locations (1)

Fix in Cursor Fix in Web

description: '',
googleDriveUrl: '',
lastUpdated: '',
ruleType: 'manual'
Copy link

Choose a reason for hiding this comment

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

Bug: Missing ruleType Causes Rule Loading Failures

The ruleType field was introduced as a required property in the Rule interface. This can cause runtime errors when loading existing rules from the system, as they may not have this field defined.

Additional Locations (1)

Fix in Cursor Fix in Web

name: '',
description: '',
ruleType: 'manual'
};
Copy link

Choose a reason for hiding this comment

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

Bug: Component/API Naming Mismatch

The RulesForm component expects ruleType in its formData, but the API provides rule_type. The test's mock data uses ruleType, which may mask this inconsistency between the component's expectation and the API's data structure.

Fix in Cursor Fix in Web

lastUpdated: '',
ruleType: 'manual'
});
}
Copy link

Choose a reason for hiding this comment

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

Bug: Rule Type Assignment Logic Flaw

When editing an existing rule, handleRuleClick incorrectly assigns the ruleType. The logic explicitly checks only for 'google_doc', causing any other rule_type value from the backend (including undefined) to default to 'manual'. This can misrepresent existing rules.

Fix in Cursor Fix in Web

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