feat: add new message box placeholder config in web widget#835
feat: add new message box placeholder config in web widget#835anish-work wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis pull request introduces a new 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
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 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_placeholderfield as a TextField with appropriate defaults for backward compatibility. The static analysis warnings from Ruff aboutClassVarannotations are false positives—dependenciesandoperationsare part of Django's migration DSL and follow the standard pattern for Django migrations.
Q/A checklist
How to check import time?
You can visualize this using tuna:
To measure import time for a specific library:
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:
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.