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,
|
||||
|
||||
@@ -172,7 +172,6 @@
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.poll-option[disabled] {
|
||||
@@ -183,10 +182,6 @@
|
||||
border-color: var(--border-light);
|
||||
}
|
||||
|
||||
.poll-option:not([disabled]):active {
|
||||
background-color: var(--bg-card-hover);
|
||||
}
|
||||
|
||||
.poll-option.chosen {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ import { OptimisticAction } from "./OptimisticAction.js";
|
||||
export class PollManager extends OptimisticAction {
|
||||
constructor() {
|
||||
super();
|
||||
this.container = null;
|
||||
document.addEventListener("pointerdown", (event) => this.onClick(event));
|
||||
document.addEventListener("click", (event) => this.onClick(event));
|
||||
document.addEventListener("submit", (event) => this.onSubmit(event), true);
|
||||
}
|
||||
|
||||
@@ -43,8 +42,7 @@ export class PollManager extends OptimisticAction {
|
||||
}
|
||||
const pollUid = poll.dataset.pollUid;
|
||||
const optionUid = option.dataset.optionUid;
|
||||
this.container = poll;
|
||||
await this.submit(`/polls/${pollUid}/vote`, { option_uid: optionUid }, this.container, (result) => this.render(poll, result));
|
||||
await this.submit(`/polls/${pollUid}/vote`, { option_uid: optionUid }, null, (result) => this.render(poll, result));
|
||||
}
|
||||
|
||||
render(poll, result) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user