Skip to content

Refactor CreatePost to use spaces with posts rooms - #22

Open
KallynGowdy wants to merge 2 commits into
devfrom
claude/nice-sagan-06h66d
Open

KallynGowdy wants to merge 2 commits into
devfrom
claude/nice-sagan-06h66d

Conversation

@KallynGowdy

Copy link
Copy Markdown
Contributor

Description

Refactors the CreatePostForm component to work with spaces and their associated posts rooms, rather than directly with feed room IDs. This change introduces a new hook useSpacesWithPostsRoom that identifies spaces containing a room whose name ends with "-posts" and pairs each space with its posts room ID.

Key changes:

  • Renamed useFeedRooms import to useSpacesWithPostsRoom and updated its implementation to return SpaceWithPostsRoom[] objects containing both spaceId and postsRoomId
  • Updated CreatePostForm to track both the selected space and its associated posts room separately
  • Changed state management from roomId to spaceId for the dropdown selector, with postsRoomId derived from the selected space
  • Updated all message sending operations to use postsRoomId instead of roomId
  • Updated UI labels and error messages to refer to "spaces" instead of "rooms" where appropriate
  • Renamed handler and variable names for clarity (handleRoomSelecthandleSpaceSelect, feedRoomsspaces, etc.)

This refactoring maintains the same user-facing functionality while improving the semantic clarity of the code by distinguishing between the space (where the user selects from) and the posts room (where messages are actually sent).

Fixes #

Checklist:

https://claude.ai/code/session_01Xskt9Qyd28qFo7vDvM5ohZ

The Share dialog's room picker now lists spaces, restricted to those
containing a room whose name ends with "-posts". Posts (text and
attachments) go to the first such room found in the selected space.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xskt9Qyd28qFo7vDvM5ohZ
Tells the user whether the selected space's "-posts" room is public
("This will be shared publicly") or private before they post.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xskt9Qyd28qFo7vDvM5ohZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants