Skip to content

Conversation

@anish-work
Copy link
Contributor

@anish-work anish-work commented Nov 13, 2025

Q/A checklist

  • I have tested my UI changes on mobile and they look acceptable
  • I have tested changes to the workflows in both the API and the UI
  • I have done a code review of my changes and looked at each line of the diff + the references of each function I have changed
  • My changes have not increased the import time of the server
How to check import time?

time python -c 'import server'

You can visualize this using tuna:

python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:

def my_function():
    import pandas as pd
    ...

Legal Boilerplate

Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.

@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new input_placeholder field to the BotIntegration model. The change includes a Django migration that adds a TextField field with blank=True and default="", updates the BotIntegration model class to include the new field and maps it to the web widget branding configuration, and adds a corresponding UI input control in the bot integration widgets configuration interface to allow users to customize the placeholder text for the message box.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent, repetitive pattern of adding a single new field across the model layer, migration layer, and UI layer. The modifications are straightforward field additions with no complex logic or control flow changes. The homogeneous nature of these changes (same field added consistently across files) reduces review complexity.

Possibly related PRs

  • change widget allow photo text #669: Modifies the same web_widget_config function in daras_ai_v2/bot_integration_widgets.py for additional bot integration widget configuration updates.

Suggested reviewers

  • devxpy

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new message box placeholder configuration feature to the web widget, which aligns with all three modified files.
Description check ✅ Passed The description includes all required checklist items (marked as completed), the import time measurement guidance, and the legal boilerplate, matching the template structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 widget_input_config

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.

@anish-work anish-work requested a review from devxpy November 13, 2025 11:19
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
daras_ai_v2/bot_integration_widgets.py (1)

431-435: Consider adding a placeholder to guide users.

The input for configuring the message box placeholder could benefit from having its own placeholder text to show users an example of what they might enter.

Apply this diff to add a helpful placeholder:

 bi.input_placeholder = gui.text_input(
     "###### Message box placeholder",
     key=f"_bi_input_placeholder_{bi.id}",
     value=bi.input_placeholder,
+    placeholder="e.g., Ask me anything...",
 )
bots/models/bot_integration.py (1)

170-170: Consider adding max_length validation for better UX.

Placeholder text is typically short (e.g., "Ask me anything..."). Without a max_length constraint, users could enter extremely long text that might break the UI or cause database bloat.

Apply this diff to add a reasonable length limit:

-    input_placeholder = models.TextField(blank=True, default="")
+    input_placeholder = models.CharField(max_length=200, blank=True, default="")

Note: This would require a new migration to change the field type from TextField to CharField.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0767507 and 87d3b79.

📒 Files selected for processing (3)
  • bots/migrations/0113_botintegration_input_placeholder.py (1 hunks)
  • bots/models/bot_integration.py (2 hunks)
  • daras_ai_v2/bot_integration_widgets.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.14.4)
bots/migrations/0113_botintegration_input_placeholder.py

8-10: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)


12-18: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (3.10.12, 1.8.3)
🔇 Additional comments (2)
bots/models/bot_integration.py (1)

603-603: LGTM!

The field is correctly mapped to the web widget branding configuration using the appropriate camelCase naming convention for JavaScript compatibility.

bots/migrations/0113_botintegration_input_placeholder.py (1)

1-18: LGTM! The migration is correct.

The migration properly adds the input_placeholder field as a TextField with appropriate defaults for backward compatibility. The static analysis warnings from Ruff about ClassVar annotations are false positives—dependencies and operations are part of Django's migration DSL and follow the standard pattern for Django migrations.

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