Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6b87b77bb |
File diff suppressed because one or more lines are too long
@@ -258,13 +258,13 @@ class NotificationDefaultForm(BaseModel):
|
||||
class AiCorrectionForm(BaseModel):
|
||||
enabled: bool = False
|
||||
sync: bool = False
|
||||
prompt: str = Field(default=DEFAULT_CORRECTION_PROMPT, max_length=20000)
|
||||
prompt: str = Field(default=DEFAULT_CORRECTION_PROMPT)
|
||||
|
||||
|
||||
class AiModifierForm(BaseModel):
|
||||
enabled: bool = False
|
||||
sync: bool = False
|
||||
prompt: str = Field(default=DEFAULT_MODIFIER_PROMPT, max_length=20000)
|
||||
prompt: str = Field(default=DEFAULT_MODIFIER_PROMPT)
|
||||
|
||||
|
||||
class InteractionsForm(BaseModel):
|
||||
|
||||
@@ -61,7 +61,7 @@ AI_CORRECTION_ACTIONS: tuple[Action, ...] = (
|
||||
),
|
||||
arg(
|
||||
"prompt",
|
||||
"The correction instruction (max 20000 chars). Omit to keep the current one.",
|
||||
"The correction instruction. Omit to keep the current one.",
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -64,7 +64,7 @@ AI_MODIFIER_ACTIONS: tuple[Action, ...] = (
|
||||
),
|
||||
arg(
|
||||
"prompt",
|
||||
"The modifier instruction (max 20000 chars). Omit to keep the current one.",
|
||||
"The modifier instruction. Omit to keep the current one.",
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -70,7 +70,7 @@ class AiCorrectionController:
|
||||
if prompt_raw is None:
|
||||
prompt = user.get("ai_correction_prompt") or DEFAULT_CORRECTION_PROMPT
|
||||
else:
|
||||
prompt = str(prompt_raw).strip()[:20000] or DEFAULT_CORRECTION_PROMPT
|
||||
prompt = str(prompt_raw).strip() or DEFAULT_CORRECTION_PROMPT
|
||||
get_table("users").update(
|
||||
{
|
||||
"uid": self._owner_id,
|
||||
|
||||
@@ -70,7 +70,7 @@ class AiModifierController:
|
||||
if prompt_raw is None:
|
||||
prompt = user.get("ai_modifier_prompt") or DEFAULT_MODIFIER_PROMPT
|
||||
else:
|
||||
prompt = str(prompt_raw).strip()[:20000] or DEFAULT_MODIFIER_PROMPT
|
||||
prompt = str(prompt_raw).strip() or DEFAULT_MODIFIER_PROMPT
|
||||
get_table("users").update(
|
||||
{
|
||||
"uid": self._owner_id,
|
||||
|
||||
@@ -16,7 +16,7 @@ export class MessagesLayout {
|
||||
}
|
||||
this.thread = document.querySelector(".messages-thread");
|
||||
this.form = document.querySelector(".messages-input-area");
|
||||
this.input = this.form ? this.form.querySelector('textarea[name="content"]') : null;
|
||||
this.input = this.form ? this.form.querySelector('input[name="content"]') : null;
|
||||
this.upload = this.form ? this.form.querySelector("dp-upload") : null;
|
||||
this.sendBtn = this.form ? this.form.querySelector(".messages-send-btn") : null;
|
||||
this._uploading = false;
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<option value="sync" {% if ai_correction_sync %}selected{% endif %}>Synchronously (wait while saving)</option>
|
||||
</select>
|
||||
</div>
|
||||
<textarea data-ai-correction-prompt class="input-sm ai-correction-prompt" maxlength="20000" rows="3" aria-label="AI content correction prompt">{{ ai_correction_prompt }}</textarea>
|
||||
<textarea data-ai-correction-prompt class="input-sm ai-correction-prompt" rows="3" aria-label="AI content correction prompt">{{ ai_correction_prompt }}</textarea>
|
||||
<div class="customization-row">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-ai-correction-save>Save</button>
|
||||
<span class="ai-correction-status" data-ai-correction-status role="status" aria-live="polite"></span>
|
||||
@@ -251,7 +251,7 @@
|
||||
<option value="sync" {% if ai_modifier_sync %}selected{% endif %}>Synchronously (wait while saving)</option>
|
||||
</select>
|
||||
</div>
|
||||
<textarea data-ai-modifier-prompt class="input-sm ai-correction-prompt" maxlength="20000" rows="3" aria-label="AI modifier prompt">{{ ai_modifier_prompt }}</textarea>
|
||||
<textarea data-ai-modifier-prompt class="input-sm ai-correction-prompt" rows="3" aria-label="AI modifier prompt">{{ ai_modifier_prompt }}</textarea>
|
||||
<div class="customization-row">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-ai-modifier-save>Save</button>
|
||||
<span class="ai-correction-status" data-ai-modifier-status role="status" aria-live="polite"></span>
|
||||
|
||||
@@ -176,7 +176,7 @@ def test_send_message_appears_in_thread(alice):
|
||||
f"{BASE_URL}/messages?with_uid={bob['uid']}", wait_until="domcontentloaded"
|
||||
)
|
||||
msg = f"Hello bob {int(time.time() * 1000)}"
|
||||
page.fill("textarea[name='content']", msg)
|
||||
page.fill("input[name='content']", msg)
|
||||
page.locator(".messages-send-btn").click()
|
||||
page.wait_for_url("**/messages**", wait_until="domcontentloaded")
|
||||
page.locator(f".message-bubble:has-text('{msg}')").first.wait_for(state="visible")
|
||||
|
||||
@@ -440,7 +440,7 @@ def test_message_notification(app_server, browser, seeded_db):
|
||||
pb.goto(f"{BASE_URL}/messages?search=alice_test", wait_until="domcontentloaded")
|
||||
pb.wait_for_timeout(2000)
|
||||
|
||||
msg_input = pb.locator("textarea[name='content']").first
|
||||
msg_input = pb.locator("input[name='content']").first
|
||||
msg_input.wait_for(state="visible", timeout=10000)
|
||||
msg_input.fill("Hello from bob_test!")
|
||||
pb.locator("button[type='submit']").last.click()
|
||||
@@ -753,7 +753,7 @@ def test_message_notification_click_opens_conversation(app_server, browser, seed
|
||||
|
||||
pb.goto(f"{BASE_URL}/messages?search=alice_test", wait_until="domcontentloaded")
|
||||
pb.wait_for_timeout(2000)
|
||||
msg_input = pb.locator("textarea[name='content']").first
|
||||
msg_input = pb.locator("input[name='content']").first
|
||||
msg_input.wait_for(state="visible", timeout=10000)
|
||||
msg_input.fill("Click-through message from bob")
|
||||
pb.locator("button[type='submit']").last.click()
|
||||
|
||||
Reference in New Issue
Block a user