Skip to content

feat(profile): private account toggle under a Permissions group (#34) - #105

Merged
Adron merged 1 commit into
parity/queuefrom
issue/34-settings-private-account
Sep 16, 2026
Merged

Adron merged 1 commit into
parity/queuefrom
issue/34-settings-private-account

Conversation

@Adron

@Adron Adron commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes #34. Part of epic #31.

Placement mirrors the web, verified on three pages

  • /help/settings lists, under an explicit Permissions heading: "Account visibility: Make your
    account private; new followers will need to request to follow you and you must approve them"
    .
  • /help/account ("Private account") and /help/people ("Private accounts") both instruct users to
    enable Private Account in "Settings, then Permissions".

So: a new Permissions group at the bottom of Settings with a single Private account switch —
same placement, same name as the web.

Deliberately not added: the web's other Permissions item, "Email visibility". There is no
corresponding field on GET /api/user or PATCH /api/user/update, so it is not implementable. The
browser geolocation permission that also lives in that section is #37's territory.

Inline explanation is sourced, not invented

All copy comes from /help/people → "Private accounts", cited in the PermissionsGroup KDoc:

New followers must send a follow request that you approve or reject. Existing followers are not
affected — they remain followers unless you remove them.

The note beneath covers what non-approved followers cannot see, where to approve/reject, and that
switching back to public does not automatically re-expose content to unapproved followers.

DEFAULT_PRIVATE_ACCOUNT = false — an absent value must read as public, so the switch never
promises a guarantee the server is not making.

Follow-requests reachability

Checked, and no nav change is needed: Routes.FOLLOW_REQUESTS is already registered and the
Account tab renders an unconditional "Follow requests" row that navigates to it. The inline note
points at "Account, then Follow requests". Worth a follow-up but not done here: that row shows no
pending count, and GET /api/follow/{userId}/counts returns pendingRequests, so a badge would be
a genuine improvement — it touches the Account screen and its ViewModel, which is a separate change.

Verification

TDD — unit tests written first and confirmed red (unresolved setPrivateAccount /
isPrivateAccountOrDefault / DEFAULT_PRIVATE_ACCOUNT) before implementing.

./gradlew :app:assembleDebug testDebugUnitTest → BUILD SUCCESSFUL; repo-wide 919 tests, 0
failures
across 118 classes (:feature:profile alone: 211). 6 Compose tests compile-verified only
(no emulator) — the issue's "UI reflects the current state after a refresh" requirement is
additionally covered by JVM-runnable ViewModel tests.

Also fixed in passing: FakeSettingsRepository's merge was silently dropping isPrivateAccount.

Reviewer notes

Add the isPrivateAccount toggle to the Settings screen, in a Permissions
group that mirrors where the web files it: its Settings page lists
"Account visibility" under Permissions, and /help/account and
/help/people both tell users to enable Private Account in "Settings,
then Permissions".

Because this setting changes who can see the user's content, the
consequence is spelled out next to the switch in the help centre's own
words (/help/people, "Private accounts"): new follows become follow
requests to approve or reject, existing followers are unaffected,
non-approved followers cannot see private messages, and going public
again does not re-expose content to unapproved followers. The note also
points at Account, then Follow requests, which is the existing route to
the approve/reject screen.

The write follows the established partial-PATCH pattern: only
isPrivateAccount goes on the body, it applies optimistically and rolls
back when the server refuses, and an absent value reads as public so the
switch never claims a privacy guarantee the server is not making.

Tests: SettingsPrivateAccountTest covers the single-field PATCH,
optimistic apply, rollback on failure, the no-op when unchanged and the
state after a refresh; DefaultSettingsRepositoryTest asserts the wire
body carries isPrivateAccount alone as a JSON boolean; SettingsScreenTest
asserts the switch reflects the stored state (including after a refresh)
and that the explanation is shown.

Closes #34
@Adron
Adron merged commit 427b46a into parity/queue Sep 16, 2026
1 check passed
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.

1 participant