From 8a2a84fa35aa77eb56b812e034062d24792cd1b0 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Fri, 24 Apr 2026 23:43:13 +0300 Subject: [PATCH] fix: make it build --- .github/workflows/changelog.yml | 47 -------- .github/workflows/unused_styles_updater.yml | 16 --- AGENTS.md | 112 +----------------- Telegram/CMakeLists.txt | 14 +-- Telegram/SourceFiles/boxes/about_box.cpp | 2 +- .../SourceFiles/history/history_widget.cpp | 1 - .../history/view/history_view_message.cpp | 2 +- .../platform/mac/global_menu_mac.mm | 6 +- .../settings/sections/settings_main.cpp | 1 + Telegram/lib_ui | 2 +- 10 files changed, 16 insertions(+), 187 deletions(-) delete mode 100644 .github/workflows/changelog.yml delete mode 100644 .github/workflows/unused_styles_updater.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index 294f1ad3ef..0000000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Changelog - -on: - push: - branches: [dev] - paths: [changelog.txt] - release: - types: [published] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: pages - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - - name: Generate HTML - run: python .github/scripts/generate_changelog.py - - - name: Upload pages artifact - uses: actions/upload-pages-artifact@v4 - with: - path: docs - - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deploy.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deploy - uses: actions/deploy-pages@v5 diff --git a/.github/workflows/unused_styles_updater.yml b/.github/workflows/unused_styles_updater.yml deleted file mode 100644 index 2c021d1cd0..0000000000 --- a/.github/workflows/unused_styles_updater.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Unused styles updater. - -on: - repository_dispatch: - types: ["Restart unused_styles_updater workflow."] - schedule: - - cron: "0 3 1 * *" - workflow_dispatch: - -jobs: - Unused-styles: - runs-on: ubuntu-latest - steps: - - uses: desktop-app/action_code_updater@master - with: - type: "unused-styles" diff --git a/AGENTS.md b/AGENTS.md index ec1650302b..3e9dfac644 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,116 +2,9 @@ This guide defines repository-wide instructions for coding agents working with the Telegram Desktop codebase. -## Build System Structure +Avoid building the project. -The build system expects this directory layout: - -```text -L:\Telegram\ # BuildPath -L:\Telegram\tdesktop\ # Repository (you work here) -L:\Telegram\Libraries\ # 32-bit dependencies (Linux/macOS) -L:\Telegram\win64\Libraries\ # 64-bit dependencies (Windows) -L:\Telegram\ThirdParty\ # Build tools (NuGet, Python, etc.) -``` - -Dependencies are located relative to the repository: `../Libraries`, `../win64/Libraries`, or `../ThirdParty`. - -## Build Configuration - -### Build Commands - -**From repository root, run:** - -```bash -cmake --build out --config Debug --target Telegram -``` - -That's it. The `out/` directory is already configured. The executable will be at `out/Debug/Telegram.exe`. - -**Important:** When running cmake from a shell that doesn't support `cd`, use quoted absolute paths: -```bash -cmake --build "l:\Telegram\tx64\out" --config Debug --target Telegram -``` - -**Never build Release** - it's extremely heavy and not needed for testing changes. - -## Platform-Specific Requirements - -### Windows -- Requires Visual Studio 2022 -- Must run from appropriate Native Tools Command Prompt: - - "x64 Native Tools Command Prompt" for `win64` - - "x86 Native Tools Command Prompt" for `win` - - "ARM64 Native Tools Command Prompt" for `winarm` -- Dependencies: `../win64/Libraries` (64-bit) or `../Libraries` (32-bit) - -### macOS -- Requires Xcode -- Dependencies: `../Libraries/local/Qt-*` -- Set `QT` environment variable: `export QT=6.8` - -### Linux -- Build dependencies in `../Libraries` -- Set `QT` environment variable if needed - -## Key Files - -- **`Telegram/build/version`** - Version information -- **`out/`** - Build output directory - -## Troubleshooting - -### "Libraries not found" -Ensure the repository is in `L:\Telegram\tdesktop`. The build system requires `../win64/Libraries` to exist. - -### Build fails with "wrong command prompt" -On Windows, use the correct Visual Studio Native Tools Command Prompt matching your target (x64/x86/ARM64). - -### Build fails with PDB or EXE access errors - -**⚠️ CRITICAL: DO NOT RETRY THE BUILD. STOP AND WAIT FOR USER.** - -If the build fails with ANY of these errors: -- `fatal error C1041: cannot open program database` -- `cannot open output file 'Telegram.exe'` -- `LNK1104: cannot open file` -- Any "access denied" or "file in use" error - -**STOP IMMEDIATELY.** These errors mean files are locked by a running process (Telegram.exe or debugger). - -**What to do:** -1. Do NOT attempt another build - it will fail the same way -2. Do NOT try to delete files - they are locked -3. Do NOT try any workarounds or fixes -4. IMMEDIATELY inform the user: - -> "Build failed - files are locked. Please close Telegram.exe (and any debugger) so I can rebuild." - -**Then WAIT for user confirmation before attempting any build.** - -Retrying builds wastes time and context. The ONLY fix is for the user to close the running process. - -## Best Practices - -1. **Always use Debug builds** - Release builds are extremely heavy -2. **Don't build Release configuration** - it's too heavy for testing - -## Text File Format - -- On Windows, keep project text files with CRLF line endings. -- Do not save source, header, build/config, style, or localization files as UTF-8 with BOM. Use UTF-8 without BOM. -- When rewriting project text files for normalization, preserve file content otherwise and do not introduce a BOM. - -## Local Storage Serialization - -Both app-level (`Core::Settings`) and session-level (`Main::SessionSettings`) use sequential binary serialization via `QDataStream`. Key rules: - -- New fields must ALWAYS be appended at the **end** of the stream, never inserted in the middle -- Reading new fields must be guarded with `!stream.atEnd()` and provide a meaningful default/fallback -- Inserting in the middle breaks reading of data saved by older versions (the new read code consumes bytes that belong to subsequent fields) -- For simple flags and values, prefer using the generic KV prefs facility (`writePref` / `readPref`) instead of adding to the binary stream -- this avoids serialization ordering issues entirely - ---- +If you're asked to create a Pull Request, then clearly state in PR description that it was AI generated. # Development Guidelines @@ -449,4 +342,3 @@ The `Error` template parameter defaults to `rpl::no_error`: `rpl::producer Text() { lt_gpl_link, rpl::single(Ui::Text::Link( "GNU GPL", - "https://github.com/AyuGram/AyuGramDesktop/blob/master/LICENSE")), + "https://github.com/AyuGram/AyuGramDesktop/blob/dev/LICENSE")), lt_github_link, rpl::single(Ui::Text::Link( "GitHub", diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 390e9babaa..1c8463845b 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -712,7 +712,6 @@ HistoryWidget::HistoryWidget( item->mainView()->itemDataChanged(); }, lifetime()); - rpl::merge( session().changes().peerUpdates( Data::PeerUpdate::Flag::IsBlocked diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 9bc89d7f2b..0772dcc7d7 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -70,7 +70,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace HistoryView { namespace { -constexpr auto kPlayStatusLimit = 2; +constexpr auto kPlayStatusLimit = 12; constexpr auto kMaxWidth = (1 << 16) - 1; constexpr auto kMaxNiceToReadLines = 6; const auto kPsaTooltipPrefix = "cloud_lng_tooltip_psa_"; diff --git a/Telegram/SourceFiles/platform/mac/global_menu_mac.mm b/Telegram/SourceFiles/platform/mac/global_menu_mac.mm index 19390fa11b..5db89e694a 100644 --- a/Telegram/SourceFiles/platform/mac/global_menu_mac.mm +++ b/Telegram/SourceFiles/platform/mac/global_menu_mac.mm @@ -291,11 +291,11 @@ void Manager::buildAppleMenu(QMenu *main) { { auto callback = [this] { withActiveWindow([](not_null window) { - window->show(Box(AboutBox)); + window->show(Box(AboutBox, window->sessionController())); }); }; const auto about = main->addAction( - u"About Telegram"_q, + u"About AyuGram"_q, std::move(callback)); about->setMenuRole(QAction::AboutQtRole); } @@ -551,7 +551,7 @@ void Manager::buildWindowMenu(QMenu *window) { } void Manager::buildMenu() { - buildAppleMenu(_menuBar->addMenu(u"Telegram"_q)); + buildAppleMenu(_menuBar->addMenu(u"AyuGram"_q)); buildFileMenu(_menuBar->addMenu(u"File"_q)); buildEditMenu(_menuBar->addMenu(u"Edit"_q)); buildWindowMenu(_menuBar->addMenu(u"Window"_q)); diff --git a/Telegram/SourceFiles/settings/sections/settings_main.cpp b/Telegram/SourceFiles/settings/sections/settings_main.cpp index 0998884aec..fbe74c4c04 100644 --- a/Telegram/SourceFiles/settings/sections/settings_main.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_main.cpp @@ -92,6 +92,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ayu/ui/utils/ayu_profile_values.h" #include "ayu/utils/telegram_helpers.h" + namespace Settings { namespace { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index cf3632f5a7..51673cadc1 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit cf3632f5a74875a6667e2b1553ccb857e12dacb2 +Subproject commit 51673cadc14c3a45a67c37364b33b0d572d9b1cf