Files
twblue/src/wxUI/buffers/atprotosocial/panels.py

382 lines
15 KiB
Python
Raw Normal View History

Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
# -*- coding: utf-8 -*-
import wx
import languageHandler # Ensure _() is available
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
import logging
import wx
import config
from mysc.repeating_timer import RepeatingTimer
2025-11-07 09:24:02 +01:00
import arrow
import arrow
from datetime import datetime
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
from multiplatform_widgets import widgets
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
log = logging.getLogger("wxUI.buffers.atprotosocial.panels")
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
class ATProtoSocialHomeTimelinePanel(object):
"""Minimal Home timeline buffer for Bluesky.
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
Exposes a .buffer wx.Panel with a List control and provides
start_stream()/get_more_items() to fetch items from atproto.
"""
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def __init__(self, parent, name: str, session):
super().__init__()
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
self.session = session
self.account = session.get_name()
self.name = name
self.type = "home_timeline"
self.invisible = True
self.needs_init = True
self.buffer = _HomePanel(parent, name)
self.buffer.session = session
self.buffer.name = name
# Ensure controller can resolve current account from the GUI panel
self.buffer.account = self.account
2025-11-07 09:24:02 +01:00
self.items = [] # list of dicts: {uri, author, handle, display_name, text, indexed_at}
self.cursor = None
self._auto_timer = None
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def start_stream(self, mandatory=False, play_sound=True):
"""Fetch newest items and render them."""
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
count = self.session.settings["general"]["max_posts_per_call"] or 40
except Exception:
count = 40
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
api = self.session._ensure_client()
# The atproto SDK expects params, not raw kwargs
try:
from atproto import models as at_models # type: ignore
2025-11-07 09:24:02 +01:00
# Home: algorithmic/default timeline
try:
params = at_models.AppBskyFeedGetTimeline.Params(limit=count)
res = api.app.bsky.feed.get_timeline(params)
except Exception:
# Some SDKs may require explicit algorithm for home; try behavioral
params = at_models.AppBskyFeedGetTimeline.Params(limit=count, algorithm="behavioral")
res = api.app.bsky.feed.get_timeline(params)
except Exception:
# Fallback to plain dict params if typed models unavailable
res = api.app.bsky.feed.get_timeline({"limit": count})
feed = getattr(res, "feed", [])
self.cursor = getattr(res, "cursor", None)
self.items = []
for it in feed:
post = getattr(it, "post", None)
if not post:
continue
2025-11-07 09:24:02 +01:00
# No additional client-side filtering; server distinguishes timelines correctly
record = getattr(post, "record", None)
author = getattr(post, "author", None)
text = getattr(record, "text", "") if record else ""
handle = getattr(author, "handle", "") if author else ""
2025-11-07 09:24:02 +01:00
display_name = (
getattr(author, "display_name", None)
or getattr(author, "displayName", None)
or ""
) if author else ""
indexed_at = getattr(post, "indexed_at", None)
2025-11-07 09:24:02 +01:00
item = {
"uri": getattr(post, "uri", ""),
2025-11-07 09:24:02 +01:00
"author": display_name or handle,
"handle": handle,
"display_name": display_name,
"text": text,
"indexed_at": indexed_at,
2025-11-07 09:24:02 +01:00
}
self._append_item(item, to_top=self._reverse())
# Full rerender to ensure column widths and selection
self._render_list(replace=True)
return len(self.items)
except Exception:
log.exception("Failed to load Bluesky home timeline")
self.buffer.list.clear()
self.buffer.list.insert_item(False, _("Error"), _("Could not load timeline."), "")
return 0
def get_more_items(self):
if not self.cursor:
return 0
try:
api = self.session._ensure_client()
try:
from atproto import models as at_models # type: ignore
params = at_models.AppBskyFeedGetTimeline.Params(limit=40, cursor=self.cursor)
res = api.app.bsky.feed.get_timeline(params)
except Exception:
res = api.app.bsky.feed.get_timeline({"limit": 40, "cursor": self.cursor})
feed = getattr(res, "feed", [])
self.cursor = getattr(res, "cursor", None)
new_items = []
for it in feed:
post = getattr(it, "post", None)
if not post:
continue
2025-11-07 09:24:02 +01:00
# No additional client-side filtering
record = getattr(post, "record", None)
author = getattr(post, "author", None)
text = getattr(record, "text", "") if record else ""
handle = getattr(author, "handle", "") if author else ""
2025-11-07 09:24:02 +01:00
display_name = (
getattr(author, "display_name", None)
or getattr(author, "displayName", None)
or ""
) if author else ""
indexed_at = getattr(post, "indexed_at", None)
new_items.append({
"uri": getattr(post, "uri", ""),
2025-11-07 09:24:02 +01:00
"author": display_name or handle,
"handle": handle,
"display_name": display_name,
"text": text,
"indexed_at": indexed_at,
})
if not new_items:
return 0
2025-11-07 09:24:02 +01:00
for it in new_items:
self._append_item(it, to_top=self._reverse())
# Render only the newly added slice
self._render_list(replace=False, start=len(self.items) - len(new_items))
return len(new_items)
except Exception:
log.exception("Failed to load more Bluesky timeline items")
return 0
2025-11-07 09:24:02 +01:00
# Alias to integrate with mainController expectations for ATProto
def load_more_posts(self, *args, **kwargs):
return self.get_more_items()
def _reverse(self) -> bool:
try:
return bool(self.session.settings["general"].get("reverse_timelines", False))
except Exception:
return False
def _append_item(self, item: dict, to_top: bool = False):
if to_top:
self.items.insert(0, item)
else:
self.items.append(item)
def _render_list(self, replace: bool, start: int = 0):
if replace:
self.buffer.list.clear()
for i in range(start, len(self.items)):
it = self.items[i]
dt = ""
if it.get("indexed_at"):
try:
2025-11-07 09:24:02 +01:00
# Mastodon-like date formatting: relative or full date
rel = False
try:
rel = bool(self.session.settings["general"].get("relative_times", False))
except Exception:
rel = False
ts = arrow.get(str(it["indexed_at"]))
if rel:
dt = ts.humanize(locale=languageHandler.curLang[:2])
else:
dt = ts.format(_("dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2])
except Exception:
2025-11-07 09:24:02 +01:00
try:
dt = str(it["indexed_at"])[:16].replace("T", " ")
except Exception:
dt = ""
text = it.get("text", "").replace("\n", " ")
if len(text) > 200:
text = text[:197] + "..."
2025-11-07 09:24:02 +01:00
# Display name and handle like Mastodon: "Display (@handle)"
author_col = it.get("author", "")
handle = it.get("handle", "")
if handle and it.get("display_name"):
author_col = f"{it.get('display_name')} (@{handle})"
elif handle and not author_col:
author_col = f"@{handle}"
self.buffer.list.insert_item(False, author_col, text, dt)
# For compatibility with controller expectations
def save_positions(self):
try:
pos = self.buffer.list.get_selected()
self.session.db[self.name + "_pos"] = pos
except Exception:
pass
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
# Support actions that need a selected item identifier (e.g., reply)
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def get_selected_item_id(self):
try:
idx = self.buffer.list.get_selected()
if idx is None or idx < 0:
return None
return self.items[idx].get("uri")
except Exception:
return None
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
2025-11-07 09:24:02 +01:00
def get_message(self):
try:
idx = self.buffer.list.get_selected()
if idx is None or idx < 0:
return ""
it = self.items[idx]
author = it.get("display_name") or it.get("author") or ""
handle = it.get("handle")
if handle:
author = f"{author} (@{handle})" if author else f"@{handle}"
text = it.get("text", "").replace("\n", " ")
dt = ""
if it.get("indexed_at"):
try:
dt = str(it["indexed_at"])[:16].replace("T", " ")
except Exception:
dt = ""
parts = [p for p in [author, text, dt] if p]
return ", ".join(parts)
except Exception:
return ""
# Auto-refresh support (polling) to simulate near real-time updates
def _periodic_refresh(self):
try:
# Ensure UI updates happen on the main thread
wx.CallAfter(self.start_stream, False, False)
except Exception:
pass
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def enable_auto_refresh(self, seconds: int | None = None):
try:
if self._auto_timer:
return
if seconds is None:
# Use global update_period (minutes) → seconds; minimum 15s
minutes = config.app["app-settings"].get("update_period", 2)
seconds = max(15, int(minutes * 60))
self._auto_timer = RepeatingTimer(seconds, self._periodic_refresh)
self._auto_timer.start()
except Exception:
log.exception("Failed to enable auto refresh for Bluesky panel %s", self.name)
def disable_auto_refresh(self):
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
if self._auto_timer:
self._auto_timer.stop()
self._auto_timer = None
except Exception:
pass
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
class _HomePanel(wx.Panel):
def __init__(self, parent, name):
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
super().__init__(parent, name=name)
self.name = name
self.type = "home_timeline"
sizer = wx.BoxSizer(wx.VERTICAL)
self.list = widgets.list(self, _("Author"), _("Post"), _("Date"), style=wx.LC_REPORT | wx.LC_SINGLE_SEL)
self.list.set_windows_size(0, 120)
self.list.set_windows_size(1, 360)
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
self.list.set_windows_size(2, 150)
self.list.set_size()
sizer.Add(self.list.list, 1, wx.EXPAND | wx.ALL, 0)
self.SetSizer(sizer)
class ATProtoSocialFollowingTimelinePanel(ATProtoSocialHomeTimelinePanel):
"""Following-only timeline (reverse-chronological)."""
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def __init__(self, parent, name: str, session):
super().__init__(parent, name, session)
self.type = "following_timeline"
# Make sure the underlying wx panel also reflects this type
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
self.buffer.type = "following_timeline"
except Exception:
pass
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
def start_stream(self, mandatory=False, play_sound=True):
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
count = self.session.settings["general"]["max_posts_per_call"] or 40
except Exception:
count = 40
Hi there! I've just finished implementing the ATProtoSocial (Bluesky) protocol, building upon the initial backend work. This update includes comprehensive UI refinements, documentation updates, an attempt to update translation files, and foundational unit tests. Here's a breakdown of what I accomplished: 1. **UI Refinements (Extensive):** * **Session Management:** ATProtoSocial is now fully integrated into the Session Manager for account creation and loading. * **Compose Dialog:** I created and wired up a new generic `ComposeDialog`. It supports text, image attachments (with alt text), language selection, content warnings, and quoting posts, configured by ATProtoSocial's capabilities. * **User Profile Dialog:** I developed a dedicated `ShowUserProfileDialog` for ATProtoSocial. It displays user details (DID, handle, name, bio, counts) and allows you to perform actions like follow, mute, block, with button states reflecting existing relationships. * **Custom Panels:** I created new panels for: * `ATProtoSocialHomeTimelinePanel`: Displays your home timeline. * `ATProtoSocialUserTimelinePanel`: Displays a specific user's posts. * `ATProtoSocialNotificationPanel`: Displays notifications. * `ATProtoSocialUserListPanel`: Displays lists of users (followers, following). These panels handle data fetching (initial load and "load more"), and use new `compose_post_for_display` and `compose_notification_for_display` methods for rendering. * **Controller Integration:** I updated `mainController.py` and `atprotosocial/handler.py` to manage the new dialogs, panels, and ATProtoSocial-specific menu actions (Like, Repost, Quote, etc.). Asynchronous operations are handled using `wx.CallAfter`. 2. **Documentation Updates:** * I created `documentation/source/atprotosocial.rst` detailing Bluesky support, account setup, and features. * I updated `documentation/source/index.rst` to include the new page. * I updated `documentation/source/basic_concepts.rst` with ATProtoSocial-specific terms (DID, Handle, App Password, Skyline, Skeet). * I added a comprehensive entry to `doc/changelog.md` for this feature. 3. **Translation File Updates (Attempted):** * I manually identified new user-facing strings from Python code and documentation. * I manually updated `tools/twblue.pot` (application strings) and `tools/twblue-documentation.pot` (documentation strings) with these new strings. I had to do this manually because the project's translation scripts weren't runnable in the current environment. * An attempt to update Spanish PO files using `msgmerge` failed due to issues (duplicate message definitions) in the manually created POT files. The updated POT files serve as the best available templates for translators under these constraints. 4. **Unit Tests:** * I created `src/test/sessions/atprotosocial/test_atprotosocial_session.py`. * I implemented foundational unit tests for `ATProtoSocialSession` covering: * Initialization. * Mocked authentication (login/authorize, success/failure). * Mocked post sending (text, quotes, media). * Mocked timeline fetching (home, user). * Mocked notification fetching and handler dispatch. * The tests utilize `unittest.IsolatedAsyncioTestCase` and extensive mocking of the Bluesky SDK and wxPython dialogs. **Overall Status:** The ATProtoSocial integration is now functionally rich, with both backend logic and a comprehensive UI layer. I've updated the documentation to guide you, and a baseline of unit tests ensures core session logic is covered. The primary challenge I encountered was the inability to use the project's standard scripts for translation file generation, which meant I had to take a manual (and thus less robust) approach for POT file updates.
2025-05-30 16:16:21 +00:00
try:
api = self.session._ensure_client()
2025-11-07 09:24:02 +01:00
# Following timeline via reverse-chronological algorithm on get_timeline
# Use plain dict to avoid typed-model mismatches across SDK versions
res = api.app.bsky.feed.get_timeline({"limit": count, "algorithm": "reverse-chronological"})
feed = getattr(res, "feed", [])
self.cursor = getattr(res, "cursor", None)
self.items = []
for it in feed:
post = getattr(it, "post", None)
if not post:
continue
record = getattr(post, "record", None)
author = getattr(post, "author", None)
text = getattr(record, "text", "") if record else ""
handle = getattr(author, "handle", "") if author else ""
2025-11-07 09:24:02 +01:00
display_name = (
getattr(author, "display_name", None)
or getattr(author, "displayName", None)
or ""
) if author else ""
indexed_at = getattr(post, "indexed_at", None)
2025-11-07 09:24:02 +01:00
item = {
"uri": getattr(post, "uri", ""),
2025-11-07 09:24:02 +01:00
"author": display_name or handle,
"handle": handle,
"display_name": display_name,
"text": text,
"indexed_at": indexed_at,
2025-11-07 09:24:02 +01:00
}
self._append_item(item, to_top=self._reverse())
self._render_list(replace=True)
return len(self.items)
except Exception:
log.exception("Failed to load Bluesky following timeline")
self.buffer.list.clear()
self.buffer.list.insert_item(False, _("Error"), _("Could not load timeline."), "")
return 0
2025-11-07 09:24:02 +01:00
def get_more_items(self):
if not self.cursor:
return 0
try:
api = self.session._ensure_client()
# Pagination via reverse-chronological algorithm on get_timeline
res = api.app.bsky.feed.get_timeline({"limit": 40, "cursor": self.cursor, "algorithm": "reverse-chronological"})
feed = getattr(res, "feed", [])
self.cursor = getattr(res, "cursor", None)
new_items = []
for it in feed:
post = getattr(it, "post", None)
if not post:
continue
record = getattr(post, "record", None)
author = getattr(post, "author", None)
text = getattr(record, "text", "") if record else ""
handle = getattr(author, "handle", "") if author else ""
display_name = (
getattr(author, "display_name", None)
or getattr(author, "displayName", None)
or ""
) if author else ""
indexed_at = getattr(post, "indexed_at", None)
new_items.append({
"uri": getattr(post, "uri", ""),
"author": display_name or handle,
"handle": handle,
"display_name": display_name,
"text": text,
"indexed_at": indexed_at,
})
if not new_items:
return 0
for it in new_items:
self._append_item(it, to_top=self._reverse())
self._render_list(replace=False, start=len(self.items) - len(new_items))
return len(new_items)
except Exception:
log.exception("Failed to load more items for following timeline")
return 0