Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Oct 30, 2025

Screenshot 2025-10-31 at 12 28 11 Screenshot 2025-10-31 at 12 28 04

Proposed changes:

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

obenland and others added 5 commits October 29, 2025 21:06
Major architectural changes:
- Replaced custom routing with simpler state-based navigation
- Implemented three-panel layout (sidebar, stage, inspector)
- Created reusable Page and Panel components for consistent UI structure
- Organized routes by section (dashboard, followers, following, interactions)

Component improvements:
- Layout: Dark theme (#1e1e1e) with fullscreen mode support
- Sidebar: 300px fixed width with visible menu items on dark background
- Stage: Main content area with DataViews tables and action buttons
- Inspector: 380px conditional panel for item details

TypeScript improvements:
- Added explicit action types for Redux store (SetFollowersAction, etc.)
- Created store.d.ts for @wordpress/data module augmentation
- Fixed React JSX transform configuration (react-jsx mode)
- Added missing icon type definitions

Styling:
- Consolidated styles into style-index.css via style.scss entry point
- Added fullscreen body class management with useEffect hook
- Used wpds design tokens for consistency with WordPress Design System
- Proper margin-based spacing between panels
Changed the sidebar header title from 'ActivityPub' to 'Social Web' and updated menu item labels to use translation functions. This improves localization and better reflects the section's purpose.
Introduces a 'feed' resource to the Redux store, including actions, selectors, and async fetching logic for ActivityPub posts. Updates the sidebar navigation to include a Feed section and ensures feed data is loaded alongside followers, following, and interactions. This prepares the UI for displaying a user's ActivityPub feed.
Uncomments the line that runs PHP Code Sniffer on changed PHP files, ensuring code formatting is enforced during pre-commit.
@pfefferle pfefferle changed the base branch from trunk to refactor/social-web-ui-second-pass October 30, 2025 10:13
@github-actions github-actions bot added [Feature] Collections [Focus] Editor Changes to the ActivityPub experience in the block editor [Status] In Progress labels Oct 30, 2025
matticbot and others added 2 commits October 30, 2025 10:14
Replaces the actor object's properties in FeedPost with new fields: ID, post_title, post_excerpt, and guid. Removes the previous fields such as id, name, preferredUsername, url, icon, and type to reflect updated data structure.
@pfefferle pfefferle self-assigned this Oct 30, 2025
pfefferle and others added 5 commits October 30, 2025 14:24
- Replace classnames with clsx for better class name handling
- Restructure store into modular files (actions, selectors, reducer, types)
- Replace hardcoded colors with wpds design tokens throughout SCSS
- Move WordPress type declarations to project root /types/
- Create route-specific types.ts files for better organization
- Add ThemedSurface component for consistent styled surfaces
- Refactor Panel component to use ThemedSurface internally
- Simplify design-tokens.scss to use wpds tokens directly

All styling now uses wpds token names with fallback values for consistent theming.
Import style.scss from the JavaScript entry point to bundle all styles
(global styles and component styles) into a single style-index.css file.
This simplifies the build output and ensures fullscreen layout styles are
properly applied.

- Import style.scss in index.tsx to bundle all styles together
- Remove editorStyle from block.json since styles are imported directly
- Remove inline background style from root element
- Clean up debug console.log statements
Base automatically changed from refactor/social-web-ui-second-pass to add/reader October 30, 2025 16:04
Introduces a 'feed' section to the sidebar and Redux store, including actions, selectors, and reducers for fetching and managing feed posts. Updates the layout and data hooks to support the new feed resource, and ensures dashboard statistics now include post counts. This enhances the social web interface with feed viewing capabilities.
Enhanced the social web sidebar by adding a site hub component with site icon, title, and a button to open the command palette. Updated dependencies to include 'wp-commands', 'wp-html-entities', and 'wp-url' to support new features.
Imported the 'classnames' utility in src/social-web/components/layout/index.tsx to fix a missing import error. This resolves issues where the S() function (an alias for classnames) was used without being defined, ensuring proper class name composition in the layout component.
Introduces new field components for the feed inspector (author, content, date, excerpt, metadata, status, title), a custom use-feed hook, and related styles. Updates feed, layout, and sidebar logic to support the new inspector. Also adds FeedActions and style for the feed route, and updates post type handling.
Uncomments the filter hook for 'rest_ap_post_query' to allow filtering AP posts by user. This change activates the previously disabled functionality.
This commit refactors the social-web module by updating Redux store actions, reducer, selectors, and types for improved state management. UI components in fields, layout, and sidebar have been enhanced for better structure and maintainability. The use-social-web-data hook is updated to leverage the new store logic. Build files are updated to reflect these changes and add 'wp-notices' as a dependency.
Removed dashboard-specific route and types files, and updated sidebar navigation to set 'Feed' as the default section. Refactored main layout and routing logic to simplify section handling and improve maintainability. Updated related components and styles to reflect these changes.
pfefferle and others added 5 commits November 17, 2025 08:53
Implements code splitting for feed, following, and interactions routes to improve initial load performance. Routes are now loaded on demand using React.lazy() and Suspense.

Benefits:
- Reduced initial bundle size - routes download only when visited
- Faster initial page load
- Better performance through webpack code splitting
- Separate chunks for stages (feed, following, interactions) and inspectors

Webpack magic comments ensure proper chunk names for each lazy-loaded module.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The primary feed action now opens the original post in a new tab if a link is available, replacing the previous 'View Details' action. The redundant 'Open Original' action was removed, and related logic updated in both the feed actions and build output.
Implements suggestions from @obenland:
- Use Elvis operator to prioritize instrument over object for _activitypub_object_id. This ensures QuoteRequest activities correctly store the quoting post URL.
- Convert deduplicate() SQL query to WP_Query for better caching support

Changes:
- Line 99: Use `$activity->get_instrument() ?: $activity->get_object()` instead of just `$activity->get_object()`
- deduplicate(): Replace direct SQL query with WP_Query using posts_where filter, properly adding and removing the filter callback

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@obenland
Copy link
Member

hm, this is actually not working for me. ap_posts returns a list of posts but they don't get displayed

@obenland
Copy link
Member

Is it the missing pre-loading?

Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no posts displayed, currently

Move individual field files into folders matching the existing pattern used by avatar, follow-status, modified, name, and webfinger fields. Update index.ts to use consistent export syntax for all fields.
@pfefferle
Copy link
Member Author

@obenland have you properly added the correct post-metas?

@obenland
Copy link
Member

You'll have to break that down for me 🙂 It doesn't just work out of the box with ap_posts?

@pfefferle
Copy link
Member Author

@obenland no! not all blog users have subscribed to the same content especially when it is about private posts or direct messages!

See:

self::add_recipient( $id, $user_id );
and
public static function add_recipient( $post_id, $user_id ) {

@pfefferle
Copy link
Member Author

@obenland
Copy link
Member

The ap_post api endpoint returns a list of posts for me, they just don't get displayed in the app. None of the dataview component is, as a matter of fact.

If there was an empty result, I'd expect the empty message to show up, which it doesn't.

Screenshot 2025-11-17 at 9 17 19 AM

*
* @return array Modified query arguments.
*/
public static function filter_ap_post_by_user( $args ) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@obenland here is the filter that is used, to only show ap_posts that are visible to the logged-in user.

@pfefferle
Copy link
Member Author

Ah, it seems to be an issue with "Sort by Title". Can you change to "Sort by Date", to be sure that we have the same issue!?

Moved feed-stage implementation to a new module and updated Social Web entry to use the new module reference. Updated asset versioning and chunk references for proper code splitting and loading.
@pfefferle
Copy link
Member Author

I removed "Sort by Title"!

@pfefferle pfefferle requested a review from obenland November 17, 2025 15:27
@obenland
Copy link
Member

The last change didn't seem to help, I'm afraid. I'm sorry I don't have more to offer currently, I'm a bit hamstrung by not having any posts locally to test with at the moment.

Does it work for you?

Can you change to "Sort by Date", to be sure that we have the same issue!?

DataViews don't display for me, so there's no sorting that I can change, I'm afraid.

@pfefferle
Copy link
Member Author

pfefferle commented Nov 17, 2025

@obenland it does

Screenshot 2025-11-17 at 16 37 40

can you add a _activitypub_user_id Post-Meta that has you WordPress User ID to one (or all) of your ap_posts?

@pfefferle pfefferle requested a review from Copilot November 17, 2025 15:53
Copilot finished reviewing on behalf of pfefferle November 17, 2025 15:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works locally for me, so let's get it in and iterate

@pfefferle pfefferle merged commit 70d47c6 into add/reader Nov 17, 2025
20 checks passed
@pfefferle pfefferle deleted the add/stream branch November 17, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Collections [Feature] WP Admin [Focus] Editor Changes to the ActivityPub experience in the block editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants