fix(P1-4,P1-5): _onboarding_next_room + _finish_onboarding 3er-Chunking
This commit is contained in:
+31
-40
@@ -6005,29 +6005,25 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
lines.append("👉 Klicke auf eine Nummer, um den Raum einzurichten:")
|
lines.append("👉 Klicke auf eine Nummer, um den Raum einzurichten:")
|
||||||
|
|
||||||
_build = self._get_build_custom_buttons()
|
_build = self._get_build_custom_buttons()
|
||||||
EMOJI_NUMBERS = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
|
# P1-4: build_button_attachments für 3er-Chunking
|
||||||
buttons = []
|
from archivar.button_builder import build_button_attachments, EMOJI_NUMBERS
|
||||||
for i, room in enumerate(remaining):
|
num_buttons = []
|
||||||
|
for room in remaining:
|
||||||
rid = room["room_id"]
|
rid = room["room_id"]
|
||||||
emoji = EMOJI_NUMBERS[i] if i < len(EMOJI_NUMBERS) else f"{i+1}."
|
clean_name = room["name"].lstrip("#")
|
||||||
prefix = f"ONBOARD:{rid}"
|
num_buttons.append((clean_name, f"ONBOARD:{rid}"))
|
||||||
buttons.extend(_build(
|
|
||||||
[emoji],
|
|
||||||
prefix=prefix,
|
|
||||||
style="primary"
|
|
||||||
))
|
|
||||||
|
|
||||||
# Globale Buttons (style='default' = grau)
|
special_buttons = [
|
||||||
buttons.extend(_build(
|
("⏭️ Überspringen", "ONBOARD", "default"),
|
||||||
["⏭️ Überspringen", "⏰ Später"],
|
("⏰ Später", "ONBOARD", "default"),
|
||||||
prefix="ONBOARD"
|
]
|
||||||
))
|
|
||||||
|
|
||||||
attachments = [{
|
attachments = build_button_attachments(
|
||||||
"color": "#1d74f5",
|
num_buttons,
|
||||||
"title": "Weitere Räume einrichten?",
|
special_buttons,
|
||||||
"actions": buttons,
|
color="#1d74f5",
|
||||||
}]
|
title="Weitere Räume einrichten?",
|
||||||
|
)
|
||||||
await self._post_message_with_retry(operator_room_id, "\n".join(lines), attachments=attachments)
|
await self._post_message_with_retry(operator_room_id, "\n".join(lines), attachments=attachments)
|
||||||
else:
|
else:
|
||||||
await self._finish_onboarding(operator_room_id)
|
await self._finish_onboarding(operator_room_id)
|
||||||
@@ -6104,27 +6100,22 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
lines.append("👉 Klicke auf eine Nummer, um den Catch-All-Raum zu wählen:")
|
lines.append("👉 Klicke auf eine Nummer, um den Catch-All-Raum zu wählen:")
|
||||||
|
|
||||||
_build = self._get_build_custom_buttons()
|
_build = self._get_build_custom_buttons()
|
||||||
EMOJI_NUMBERS = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
|
# P1-5: build_button_attachments für 3er-Chunking
|
||||||
buttons = []
|
from archivar.button_builder import build_button_attachments, EMOJI_NUMBERS
|
||||||
for i, (rid, name, is_catch) in enumerate(all_rooms):
|
num_buttons = []
|
||||||
emoji = EMOJI_NUMBERS[i] if i < len(EMOJI_NUMBERS) else f"{i+1}."
|
for rid, name, is_catch in all_rooms:
|
||||||
prefix = f"ONBOARD:{rid}"
|
num_buttons.append((name, f"ONBOARD:{rid}"))
|
||||||
buttons.extend(_build(
|
|
||||||
[emoji],
|
|
||||||
prefix=prefix,
|
|
||||||
style="primary"
|
|
||||||
))
|
|
||||||
# Globaler Überspringen-Button
|
|
||||||
buttons.extend(_build(
|
|
||||||
["⏭️ Überspringen"],
|
|
||||||
prefix="ONBOARD"
|
|
||||||
))
|
|
||||||
|
|
||||||
attachments = [{
|
special_buttons = [
|
||||||
"color": "#1d74f5",
|
("⏭️ Überspringen", "ONBOARD", "default"),
|
||||||
"title": "Catch-All-Raum wählen",
|
]
|
||||||
"actions": buttons,
|
|
||||||
}]
|
attachments = build_button_attachments(
|
||||||
|
num_buttons,
|
||||||
|
special_buttons,
|
||||||
|
color="#1d74f5",
|
||||||
|
title="Catch-All-Raum wählen",
|
||||||
|
)
|
||||||
await self._post_message_with_retry(operator_room_id, "\n".join(lines), attachments=attachments)
|
await self._post_message_with_retry(operator_room_id, "\n".join(lines), attachments=attachments)
|
||||||
logger.info("[rocketchat] Onboarding v2 abgeschlossen: alle Räume eingerichtet")
|
logger.info("[rocketchat] Onboarding v2 abgeschlossen: alle Räume eingerichtet")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user