Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -707,18 +707,39 @@ export default function App() {
document.removeEventListener("visibilitychange", visibility);
};
}, [api, authVersion, refresh, notice, completeSwitch, switchFailure]);
// More is a flyout: a click anywhere else closes it.
// Menus are flyouts: one is open at a time, and a tap anywhere else or
// Escape closes it. Without this, More and a view's ⋯ stayed open over
// each other, and over the next view.
useEffect(() => {
const close = (event: MouseEvent) => {
const menu = document.getElementById("nav-overflow");
if (menu?.hasAttribute("open") && !menu.contains(event.target as Node)) menu.removeAttribute("open");
const menus = () => [...document.querySelectorAll<HTMLDetailsElement>("details.action-menu[open]")];
const close = (event: Event) => {
// A phone sheet's dimmed backdrop is the menu's own ::before.
for (const menu of menus()) if (!menu.contains(event.target as Node) || event.target === menu) menu.open = false;
};
const opened = (event: Event) => {
const menu = event.target;
if (!(menu instanceof HTMLDetailsElement) || !menu.open || !menu.classList.contains("action-menu")) return;
for (const other of menus()) if (other !== menu && !other.contains(menu)) other.open = false;
};
const key = (event: KeyboardEvent) => {
if (event.key !== "Escape") return;
const open = menus();
if (!open.length) return;
for (const menu of open) menu.open = false;
open[open.length - 1]?.querySelector("summary")?.focus();
};
document.addEventListener("pointerdown", close);
document.addEventListener("toggle", opened, true);
document.addEventListener("keydown", key);
return () => {
document.removeEventListener("pointerdown", close);
document.removeEventListener("toggle", opened, true);
document.removeEventListener("keydown", key);
};
document.addEventListener("click", close);
return () => document.removeEventListener("click", close);
}, []);
// ...and so does going anywhere.
useEffect(() => {
document.getElementById("nav-overflow")?.removeAttribute("open");
for (const menu of document.querySelectorAll<HTMLDetailsElement>("details.action-menu[open]")) menu.open = false;
}, [view, section.version]);
useEffect(() => {
document.body.classList.toggle("terminals-open", view === "terminals");
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/en/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "Smaller text",
"conversation.chat.largerText": "Larger text",
"conversation.chat.latest": "↓ Latest",
"conversation.chat.openTerminalShort": "⌨ Terminal",
"conversation.chat.reviewMergeShort": "± Review",
"conversation.chat.showTerminalTextShort": "Text",
"conversation.chat.showChatCardsShort": "Cards",
"conversation.chat.placeholderShort": "Message the agent…",
"conversation.chat.openTerminal": "⌨ Open terminal",
"conversation.chat.reviewMerge": "± Review & merge",
"conversation.chat.browser": "◎ Open a browser",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/en/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "Restore it",
"sessions.list.restoreCount": "Restore {count}",
"sessions.list.searchPlaceholder": "Search sessions, groups, branches or folders",
"sessions.list.searchPlaceholderShort": "Search sessions",
"sessions.list.searchLabel": "Find a session or project",
"sessions.list.groupBy": "Group by",
"sessions.list.groupByLabel": "Group sessions by",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/es/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "Texto más pequeño",
"conversation.chat.largerText": "Texto más grande",
"conversation.chat.latest": "↓ Lo último",
"conversation.chat.openTerminalShort": "⌨ Terminal",
"conversation.chat.reviewMergeShort": "± Revisar",
"conversation.chat.showTerminalTextShort": "Texto",
"conversation.chat.showChatCardsShort": "Tarjetas",
"conversation.chat.placeholderShort": "Escribe al agente…",
"conversation.chat.openTerminal": "⌨ Abrir terminal",
"conversation.chat.reviewMerge": "± Revisar y fusionar",
"conversation.chat.browser": "◎ Abrir un navegador",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/es/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "Restaurarla",
"sessions.list.restoreCount": "Restaurar {count}",
"sessions.list.searchPlaceholder": "Buscar sesiones, grupos, ramas o carpetas",
"sessions.list.searchPlaceholderShort": "Buscar sesiones",
"sessions.list.searchLabel": "Buscar una sesión o un proyecto",
"sessions.list.groupBy": "Agrupar por",
"sessions.list.groupByLabel": "Agrupar sesiones por",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/fr/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "Texte plus petit",
"conversation.chat.largerText": "Texte plus grand",
"conversation.chat.latest": "↓ Plus récent",
"conversation.chat.openTerminalShort": "⌨ Terminal",
"conversation.chat.reviewMergeShort": "± Relire",
"conversation.chat.showTerminalTextShort": "Texte",
"conversation.chat.showChatCardsShort": "Cartes",
"conversation.chat.placeholderShort": "Écrire à l’agent…",
"conversation.chat.openTerminal": "⌨ Ouvrir le terminal",
"conversation.chat.reviewMerge": "± Relire et fusionner",
"conversation.chat.browser": "◎ Ouvrir un navigateur",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/fr/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "La restaurer",
"sessions.list.restoreCount": "Restaurer {count}",
"sessions.list.searchPlaceholder": "Rechercher des sessions, groupes, branches ou dossiers",
"sessions.list.searchPlaceholderShort": "Rechercher des sessions",
"sessions.list.searchLabel": "Trouver une session ou un projet",
"sessions.list.groupBy": "Regrouper par",
"sessions.list.groupByLabel": "Regrouper les sessions par",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/ja/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "文字を小さく",
"conversation.chat.largerText": "文字を大きく",
"conversation.chat.latest": "↓ 最新",
"conversation.chat.openTerminalShort": "⌨ ターミナル",
"conversation.chat.reviewMergeShort": "± レビュー",
"conversation.chat.showTerminalTextShort": "テキスト",
"conversation.chat.showChatCardsShort": "カード",
"conversation.chat.placeholderShort": "エージェントにメッセージ…",
"conversation.chat.openTerminal": "⌨ ターミナルを開く",
"conversation.chat.reviewMerge": "± レビューとマージ",
"conversation.chat.browser": "◎ ブラウザーを開く",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/ja/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "復元する",
"sessions.list.restoreCount": "{count} 件を復元",
"sessions.list.searchPlaceholder": "セッション、グループ、ブランチ、フォルダーを検索",
"sessions.list.searchPlaceholderShort": "セッションを検索",
"sessions.list.searchLabel": "セッションまたはプロジェクトを検索",
"sessions.list.groupBy": "グループ化",
"sessions.list.groupByLabel": "セッションのグループ化",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/ko/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "글자 작게",
"conversation.chat.largerText": "글자 크게",
"conversation.chat.latest": "↓ 최신",
"conversation.chat.openTerminalShort": "⌨ 터미널",
"conversation.chat.reviewMergeShort": "± 검토",
"conversation.chat.showTerminalTextShort": "텍스트",
"conversation.chat.showChatCardsShort": "카드",
"conversation.chat.placeholderShort": "에이전트에게 메시지…",
"conversation.chat.openTerminal": "⌨ 터미널 열기",
"conversation.chat.reviewMerge": "± 리뷰 및 병합",
"conversation.chat.browser": "◎ 브라우저 열기",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/ko/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "복원하기",
"sessions.list.restoreCount": "{count}개 복원",
"sessions.list.searchPlaceholder": "세션, 그룹, 브랜치 또는 폴더 검색",
"sessions.list.searchPlaceholderShort": "세션 검색",
"sessions.list.searchLabel": "세션 또는 프로젝트 찾기",
"sessions.list.groupBy": "그룹 기준",
"sessions.list.groupByLabel": "세션 그룹 기준",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/zh/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const catalog: Record<string, string> = {
"conversation.chat.smallerText": "缩小文字",
"conversation.chat.largerText": "放大文字",
"conversation.chat.latest": "↓ 最新",
"conversation.chat.openTerminalShort": "⌨ 终端",
"conversation.chat.reviewMergeShort": "± 审查",
"conversation.chat.showTerminalTextShort": "文本",
"conversation.chat.showChatCardsShort": "卡片",
"conversation.chat.placeholderShort": "给智能体发消息…",
"conversation.chat.openTerminal": "⌨ 打开终端",
"conversation.chat.reviewMerge": "± 审查与合并",
"conversation.chat.browser": "◎ 打开浏览器",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const catalog: Record<string, string> = {
"sessions.list.restoreIt": "恢复它",
"sessions.list.restoreCount": "恢复 {count} 个",
"sessions.list.searchPlaceholder": "搜索会话、分组、分支或文件夹",
"sessions.list.searchPlaceholderShort": "搜索会话",
"sessions.list.searchLabel": "查找会话或项目",
"sessions.list.groupBy": "分组方式",
"sessions.list.groupByLabel": "会话分组方式",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { bootAppearance } from "./theme/appearance";
// Before the first render: the saved theme paints the first frame.
bootAppearance();
import "./mobile/phone.css";
import "./mobile/polish.css";
// /pair is the one page an unpaired device can reach with no credential —
// see internal/api/server.go's withAuth exemption. It gets its own render
// root entirely: no board fetches, no SSE, nothing that assumes an
Expand Down
Loading
Loading