Skip to content

Hidden diagnostics viewer, app-wide logging, unified dialogs, git hardening - #33

Merged
oustery merged 3 commits into
mainfrom
logging-dialogs-git-hardening
Nov 12, 2026
Merged

oustery merged 3 commits into
mainfrom
logging-dialogs-git-hardening

Conversation

@oustery

@oustery oustery commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Что внутри

1. Скрытый просмотрщик логов (задача 1)

  • 5 быстрых нажатий за 4 секунды по версии приложения в шторке навигации открывают экран «Диагностика» (подтверждается хаптикой; намеренно не обнаруживается — жест сообщает поддержка при отладке).
  • Экран в реальном времени хвостит буфер: фильтры по уровню (Debug/Info/Warn/Errors), поиск по тегу/тексту, автопрокрутка, счётчик записей; действия — копировать, поделиться (системный шиинг), очистить (с подтверждением).

2. Полноценное логирование и обработка ошибок (задача 2)

  • AppLog в core/model: ограниченный кольцевой буфер (1500 записей) без Android-зависимостей, зеркала — Logcat и ротируемая пара файлов filesDir/logs/; sink переживает смерть процесса для разбора багрепорта.
  • Покрыты все видимые пользователю точки отказа: старт приложения, фазы бутстрапа, запуск/падение сервера, HTTP-ошибки клиента, SSE-поток, git-операции (argv без секретов), catch-пути всех ViewModel. 4 новых юнит-теста.

3. Модальные окна приведены в порядок (задача 3)

  • Новые OcConfirmDialog/OcInputDialog в дизайн-системе: тонированная эмблема, один яркое действие + тихая отмена, деструктивные действия — красная палитра с иконкой, автофокус, валидация прямо в поле, подтверждение с клавиатуры (IME Done).
  • Все 10 простых подтверждений в 5 экранах переведены на них (удаление/сброс/перезапуск — деструктивно оформлены); Clone/New/Rename получили живую валидацию (HTTPS-URL проверяется до попытки клона); сложные диалоги (commit, вопрос агента, OAuth) сохранены, но получили эмблемы.

4. Git-работа как можно надёжнее (задача 4)

  • Классификация ошибок: identity/auth/разошедшиеся истории/пустая ветка/сеть/SSL — каждая с локализованной подсказкой следующего шага.
  • GitBar показывает ↑/↓ (непушнутые/непулнутые коммиты) из tracking-заголовка git status -b.
  • Коммит без настроенного identity сразу объясняет, куда идти в настройках; push сообщает «пушить нечего» вместо фейкового успеха.
  • Каждая git-команда и её код выхода — в диагностическом журнале (argv, без секретов).

Проверка

  • Все модули компилируются; 152 unit-теста, 0 провалов (4 новых в AppLogTest).
  • Строки EN/RU: 389 = 389, все новые ключи в обеих локалях.
  • Коммиты разделены так, что каждый собирается независимо: 56e15f2 (ядро логирования), 1f382b7 (git-харденинг + строки), 0993e6d (UI: просмотрщик + диалоги).

Z User added 3 commits November 12, 2026 13:00
A bounded in-memory log every module can append to without Android
dependencies, mirrored to Logcat and a rotating file pair
(filesDir/logs/app.log + app.old) installed by the application class.
The hidden diagnostics screen built next tails this buffer live, so a
user can capture exactly what happened — including details the message
bars truncate — before reporting a bug.

Wiring (every user-visible failure now reaches the log):
- app startup (including Keystore failures, Logcat only — no secrets);
- bootstrap phases via BootstrapManager.log();
- server start/exit failures in ManagedServer;
- OpenCodeClient HTTP rejections, HTML-instead-of-JSON and unparsable
  responses;
- ChatViewModel catch paths (agent list, todos, questions, connection,
  SSE stream, session reload);
- SettingsViewModel connection tests and sign-in method fetches.
Git operations in Files now fail with a next step, not a dead end:
- every recognised git failure class (identity missing, auth/token,
  diverged history, unborn branch, unreachable host, missing CA store)
  appends a localized hint to the error message (git_hint_* strings);
- git status tracking headers are parsed into ahead/behind counters
  exposed via FilesUiState.gitAhead/gitBehind (UI chips come with the
  GitBar change in the following commit);
- commit refuses with a pointer to Settings → Git when the identity is
  not configured, instead of git's "Please tell me who you are";
- push reports "nothing to push" when git already reports up to date
  instead of a fake success line;
- every command (argv only — credentials stay in the environment) and
  every failure lands in the AppLog diagnostic buffer with its exit code.

Strings for the hints and counters ship in both EN and RU.
Hidden log viewer (task: "скрытая возможность просмотра логов"):
- five taps within four seconds on the drawer version footer navigate to
  a Diagnostics screen (haptic confirms the unlock; deliberately
  undiscoverable — support tells the user the gesture);
- the screen tails the AppLog buffer live with minimum-level filter
  chips, tag/text search, an auto-scroll toggle and entry counts;
- actions: copy to clipboard, share as text via the system sheet, and
  clear (destructive-toned confirmation).

Unified dialog voice (task: "приведи модальные окна в порядок"):
- new OcConfirmDialog / OcInputDialog in the design system: tinted
  leading emblem, one primary action, one quiet dismissal, destructive
  actions in the error palette with a matching emblem, autofocused input
  with inline validation and IME-done-to-confirm;
- all ten simple confirmations across Files, Chat, Terminal, Settings
  and the startup path now use them (delete/discard/restart/reset/data
  clearing are destructive-toned; clone/new/rename gained live
  validation that catches non-HTTPS URLs before the clone attempt);
- the commit and session-rename dialogs keep their richer layouts but
  join the emblem convention.

GitBar shows the new ahead/behind chips (↑N/↓M) so the sync state is
visible without running a push.
@oustery
oustery merged commit 21d000b into main Nov 12, 2026
1 check failed
@oustery
oustery deleted the logging-dialogs-git-hardening branch November 12, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant