From becdad1e901b5928053c3eabc308b5bc277ea860 Mon Sep 17 00:00:00 2001 From: Rishi Balakrishnan Date: Wed, 7 Oct 2026 11:31:21 -0400 Subject: [PATCH] fix(discussions): call polls and the people's assembly "discussions" in the app --- .../Post/Embed/ExternalEmbed/AssemblyEmbed.tsx | 10 +++++----- src/lib/api/__tests__/assembly-publish.test.ts | 10 +++++----- src/lib/api/__tests__/space-post-poll.test.ts | 2 +- src/lib/api/index.ts | 8 ++++---- src/lib/api/space-post.ts | 4 +++- src/lib/strings/embed-player.ts | 2 +- src/screens/Onboarding/StepAssembly/index.tsx | 6 +++--- src/view/com/composer/Composer.tsx | 16 ++++++++-------- src/view/com/composer/PostTargetControls.tsx | 2 +- .../__tests__/PostTargetControls.test.tsx | 2 +- src/view/com/composer/drafts/DraftItem.tsx | 5 +++-- src/view/com/composer/poll/PollEditor.tsx | 8 ++++---- src/view/com/composer/poll/SelectPollBtn.tsx | 10 +++++----- .../composer/poll/__tests__/PollEditor.test.tsx | 2 +- .../poll/__tests__/SelectPollBtn.test.tsx | 4 ++-- 15 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx b/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx index 1b2cb8441..ab0811bf4 100644 --- a/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx +++ b/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx @@ -329,7 +329,7 @@ export function AssemblyEmbed({ - People's Assembly + Discussion + accessibilityHint={l`Opens the discussion page to sign in and vote`}> Sign in to vote @@ -559,7 +559,7 @@ function AssemblyHeader({ - People's Assembly + Discussion {topic ? ( @@ -598,7 +598,7 @@ function AssemblyFooter({ onPress={onPressResults} accessibilityRole="link" accessibilityLabel={l`See results`} - accessibilityHint={l`Opens the assembly results page`}> + accessibilityHint={l`Opens the discussion results page`}> See results @@ -608,7 +608,7 @@ function AssemblyFooter({ onPress={onPress} accessibilityRole="link" accessibilityLabel={l`Submit a statement`} - accessibilityHint={l`Opens the assembly conversation page`}> + accessibilityHint={l`Opens the discussion page`}> Submit a statement → diff --git a/src/lib/api/__tests__/assembly-publish.test.ts b/src/lib/api/__tests__/assembly-publish.test.ts index cc8bbe2f5..245284ce5 100644 --- a/src/lib/api/__tests__/assembly-publish.test.ts +++ b/src/lib/api/__tests__/assembly-publish.test.ts @@ -83,7 +83,7 @@ const THUMB_BLOB = { mimeType: 'image/png', size: 1234, } -const POLLS_ARE_PUBLIC = 'Polls are only available on public posts.' +const POLLS_ARE_PUBLIC = 'Discussions are only available on public posts.' const NO_THUMB = 'Failed to attach the poll thumbnail' const NO_IMAGE = 'The image could not be read in time' @@ -297,7 +297,7 @@ describe('publishing a post with a poll', () => { expect(events).toEqual([ 'stage:Processing...', - 'stage:Starting poll...', + 'stage:Starting discussion...', 'ensureAssembly', 'imageToThumb', 'stage:Uploading link thumbnail...', @@ -473,7 +473,7 @@ describe('replying with a poll', () => { expect(events).toEqual([ 'stage:Processing...', 'getPosts', - 'stage:Starting poll...', + 'stage:Starting discussion...', 'ensureAssembly', 'imageToThumb', 'stage:Uploading link thumbnail...', @@ -665,7 +665,7 @@ describe('a poll outside the public path', () => { describe('a poll with another attachment', () => { const COMBINED = - 'A poll cannot be combined with media, a link card or a quote.' + 'A discussion cannot be combined with media, a link card or a quote.' const attachments = [ {name: 'media', extra: {media: {type: 'gif', gif: {}, alt: ''}}}, { @@ -729,7 +729,7 @@ describe('poll invariants', () => { draft({poll: {statements: ['Another']}}, 'Second', 'post-2'), ]), }), - ).rejects.toThrow(new Error('A thread can only have one poll.')) + ).rejects.toThrow(new Error('A thread can only have one discussion.')) expectNothingStarted(ctx) }) diff --git a/src/lib/api/__tests__/space-post-poll.test.ts b/src/lib/api/__tests__/space-post-poll.test.ts index 7fe7bf61c..8e8aca1dc 100644 --- a/src/lib/api/__tests__/space-post-poll.test.ts +++ b/src/lib/api/__tests__/space-post-poll.test.ts @@ -36,7 +36,7 @@ describe('posting a thread into a space', () => { blackskyOnly: false, } as never, }), - ).rejects.toThrow(/Polls are not available/) + ).rejects.toThrow(/Discussions are not available/) expect(resolveRT).not.toHaveBeenCalled() expect(resolveEmbed).not.toHaveBeenCalled() diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index ea95a18cd..cb63fef81 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -95,7 +95,7 @@ function embedNamesSpaceRecord(embed: unknown): boolean { function refusePoll(thread: ThreadDraft) { if (thread.posts.some(p => p.embed.poll)) { - throw new Error(t`Polls are only available on public posts.`) + throw new Error(t`Discussions are only available on public posts.`) } } @@ -105,7 +105,7 @@ function refusePollWithAttachments(draft: PostDraft) { (draft.embed.media || draft.embed.link || draft.embed.quote) ) { throw new Error( - t`A poll cannot be combined with media, a link card or a quote.`, + t`A discussion cannot be combined with media, a link card or a quote.`, ) } } @@ -113,7 +113,7 @@ function refusePollWithAttachments(draft: PostDraft) { function findPollPost(thread: ThreadDraft): PostDraft | undefined { const [pollPost, ...others] = thread.posts.filter(p => p.embed.poll) if (others.length) { - throw new Error(t`A thread can only have one poll.`) + throw new Error(t`A thread can only have one discussion.`) } if (pollPost) { refusePollWithAttachments(pollPost) @@ -252,7 +252,7 @@ export async function post( // An assembly is public and cannot be withdrawn, so a reply whose parent // is gone has to fail before one is started. await replyPromise - opts.onStateChange?.(t`Starting poll...`) + opts.onStateChange?.(t`Starting discussion...`) const statements = pollStatementsForPublish(poll) const {ref, isReplay} = await ensureAssembly(agent, { topic: pollTopicFromText(pollPost.richtext.text), diff --git a/src/lib/api/space-post.ts b/src/lib/api/space-post.ts index a7cb079c4..c7d1bf604 100644 --- a/src/lib/api/space-post.ts +++ b/src/lib/api/space-post.ts @@ -51,7 +51,9 @@ export async function postToSpace( // Posts are written one at a time, so an unsupported draft has to be refused // before the first write rather than part-way through the thread. if (thread.posts.some(p => p.embed.poll)) { - throw new Error(t`Polls are not available in private community feeds.`) + throw new Error( + t`Discussions are not available in private community feeds.`, + ) } // Threads are written in order: each reply refers to the space URI the host diff --git a/src/lib/strings/embed-player.ts b/src/lib/strings/embed-player.ts index 4a6451654..0fe226d63 100644 --- a/src/lib/strings/embed-player.ts +++ b/src/lib/strings/embed-player.ts @@ -70,7 +70,7 @@ export const externalEmbedLabels: Record = { appleMusic: 'Apple Music', soundcloud: 'SoundCloud', flickr: 'Flickr', - assembly: "Blacksky People's Assembly", + assembly: 'Blacksky Discussions', bandcamp: 'Bandcamp', streamplace: 'Streamplace', } diff --git a/src/screens/Onboarding/StepAssembly/index.tsx b/src/screens/Onboarding/StepAssembly/index.tsx index 87490f0a8..dd7d94d29 100644 --- a/src/screens/Onboarding/StepAssembly/index.tsx +++ b/src/screens/Onboarding/StepAssembly/index.tsx @@ -30,7 +30,7 @@ export function StepAssembly() { onHelp={() => openLink(FEEDBACK_FORM_URL({}))} /> - + @@ -45,7 +45,7 @@ export function StepAssembly() { ]}> Vote on platform decisions, make proposals, and offer feedback - through our People's Assembly. + through Discussions. @@ -81,7 +81,7 @@ function StatementCard() { - People's Assembly + Discussion diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 607b3a2bb..c71baa796 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -978,21 +978,21 @@ export const ComposePost = ({ (code: AssemblyErrorCode): string => { switch (code) { case 'not_eligible': - return l`Polls are not available for your account yet.` + return l`Discussions are not available for your account yet.` case 'quota': - return l`You have started the maximum number of polls for today. Try again tomorrow.` + return l`You have started the maximum number of discussions for today. Try again tomorrow.` case 'busy': - return l`People's Assembly is busy. Wait a few seconds and post again.` + return l`Discussions are busy. Wait a few seconds and post again.` case 'invalid': - return l`This poll could not be created. Check the statements and try again.` + return l`This discussion could not be created. Check the statements and try again.` case 'conflict': - return l`This poll changed while it was being created. Please try again.` + return l`This discussion changed while it was being created. Please try again.` case 'removed': - return l`This poll was removed and cannot be posted.` + return l`This discussion was removed and cannot be posted.` case 'auth': case 'network': case 'unavailable': - return l`Could not reach People's Assembly. Your post was not sent.` + return l`Could not reach Discussions. Your post was not sent.` } }, [l], @@ -1717,7 +1717,7 @@ let ComposerPost = memo(function ComposerPost({ async (uri: string) => { if (hasPoll) { if (IS_WEB) { - Toast.show(l`Remove the poll to add media`, {type: 'warning'}) + Toast.show(l`Remove the discussion to add media`, {type: 'warning'}) } return } diff --git a/src/view/com/composer/PostTargetControls.tsx b/src/view/com/composer/PostTargetControls.tsx index ea1541d82..41069391c 100644 --- a/src/view/com/composer/PostTargetControls.tsx +++ b/src/view/com/composer/PostTargetControls.tsx @@ -43,7 +43,7 @@ export function PostTargetControls({ const hasPoll = threadHasPoll(thread) const announcePollRemoval = () => { Toast.show( - t`Polls are only available on public posts, so the poll was removed.`, + t`Discussions are only available on public posts, so the discussion was removed.`, {type: 'info'}, ) } diff --git a/src/view/com/composer/__tests__/PostTargetControls.test.tsx b/src/view/com/composer/__tests__/PostTargetControls.test.tsx index ba3637861..b38a758e0 100644 --- a/src/view/com/composer/__tests__/PostTargetControls.test.tsx +++ b/src/view/com/composer/__tests__/PostTargetControls.test.tsx @@ -118,7 +118,7 @@ const PUBLIC_RECORD_TARGET: CommunityFeedTarget = { } const POLL_REMOVED_MESSAGE = - 'Polls are only available on public posts, so the poll was removed.' + 'Discussions are only available on public posts, so the discussion was removed.' function draftPost(embed: Partial = {}) { return {embed} as ThreadDraft['posts'][number] diff --git a/src/view/com/composer/drafts/DraftItem.tsx b/src/view/com/composer/drafts/DraftItem.tsx index 1f414894d..539088f9d 100644 --- a/src/view/com/composer/drafts/DraftItem.tsx +++ b/src/view/com/composer/drafts/DraftItem.tsx @@ -298,8 +298,9 @@ function DraftPollPreview({poll}: {poll: {statements: string[]}}) { {_( msg({ - message: 'Poll', - comment: 'Label on a draft preview showing the draft has a poll', + message: 'Discussion', + comment: + 'Label on a draft preview showing the draft has a discussion', }), )} diff --git a/src/view/com/composer/poll/PollEditor.tsx b/src/view/com/composer/poll/PollEditor.tsx index 5352012db..665942327 100644 --- a/src/view/com/composer/poll/PollEditor.tsx +++ b/src/view/com/composer/poll/PollEditor.tsx @@ -65,14 +65,14 @@ export function PollEditor({ a.font_bold, {color: t.palette.primary_500, textTransform: 'uppercase'}, ]}> - - Poll + + Discussion