Reimplement compose and add tiling windows

This commit is contained in:
2026-03-12 22:03:30 +00:00
parent 79766d279d
commit 6ceff63b71
126 changed files with 5111 additions and 10796 deletions

View File

@@ -29,6 +29,9 @@ from core.models import (
)
from core.translation.engine import parse_quick_mode_title
_SUPPORTED_COMMAND_CHOICES = (("bp", "Business Plan (bp)"),)
_SUPPORTED_COMMAND_SLUGS = tuple(choice[0] for choice in _SUPPORTED_COMMAND_CHOICES)
def _channel_variants(service: str, identifier: str) -> list[str]:
value = str(identifier or "").strip()
@@ -74,7 +77,10 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
def _context(self, request):
profiles_qs = (
CommandProfile.objects.filter(user=request.user)
CommandProfile.objects.filter(
user=request.user,
slug__in=_SUPPORTED_COMMAND_SLUGS,
)
.prefetch_related("channel_bindings", "actions", "variant_policies")
.order_by("slug")
)
@@ -140,11 +146,7 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
"channel_services": ("web", "xmpp", "signal", "whatsapp"),
"directions": ("ingress", "egress", "scratchpad_mirror"),
"action_types": ("extract_bp", "post_result", "save_document"),
"command_choices": (
("bp", "Business Plan (bp)"),
("codex", "Codex (codex)"),
("claude", "Claude (claude)"),
),
"command_choices": _SUPPORTED_COMMAND_CHOICES,
"scope_service": scope_service,
"scope_identifier": scope_identifier,
"scope_variants": scope_variants,
@@ -166,16 +168,10 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
.lower()
or "bp"
)
default_name = {
"bp": "Business Plan",
"codex": "Codex",
"claude": "Claude",
}.get(slug, "Business Plan")
default_trigger = {
"bp": ".bp",
"codex": ".codex",
"claude": ".claude",
}.get(slug, ".bp")
if slug not in _SUPPORTED_COMMAND_SLUGS:
slug = "bp"
default_name = "Business Plan"
default_trigger = ".bp"
profile, _ = CommandProfile.objects.get_or_create(
user=request.user,
slug=slug,
@@ -198,14 +194,6 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
profile.template_text = str(
request.POST.get("template_text") or profile.template_text or ""
)
if slug == "codex":
profile.trigger_token = ".codex"
profile.reply_required = False
profile.exact_match_only = False
if slug == "claude":
profile.trigger_token = ".claude"
profile.reply_required = False
profile.exact_match_only = False
profile.save(
update_fields=[
"name",
@@ -519,23 +507,6 @@ class AIExecutionLogSettings(LoginRequiredMixin, View):
"runs": runs,
"operation_breakdown": operation_breakdown,
"model_breakdown": model_breakdown,
"settings_nav": {
"title": "AI",
"tabs": [
{
"label": "Models",
"href": reverse("ai_models"),
"active": str(getattr(request, "path", "") or "")
== reverse("ai_models"),
},
{
"label": "Traces",
"href": reverse("ai_execution_log"),
"active": str(getattr(request, "path", "") or "")
== reverse("ai_execution_log"),
},
],
},
}
def get(self, request):