Adopt the events-style "log in to do this" toast in forum / market / tasks #33

Open
opened 2026-05-02 08:52:38 +00:00 by padreug · 0 comments
Owner

The activities (events) module shows a friendly toast when an unauthenticated user lands on a route that needs an account, with an inline "Log In" action button that takes them straight to /login. This is the canonical pattern for our public-browsable modules and the other public modules should match.

Canonical example

src/modules/activities/views/ActivitiesFavoritesPage.vue:30

onMounted(() => {
  if (!isAuthenticated.value) {
    toast.info(t('activities.favorites.loginPrompt'), {
      action: {
        label: t('activities.favorites.logIn'),
        onClick: () => router.push('/login'),
      },
    })
  }
})

Modules to audit

  • Forum — current state: vote, comment, and reply buttons just disable when !isAuthenticated. A first-time visitor taps a disabled button and gets no feedback. Add the toast on tap of any disabled write action (or on entering /submit while unauth — see src/modules/forum/components/SubmissionRow.vue:127, SubmissionComment.vue:177-198, SubmissionDetail.vue:123-151).
  • Market — needs an audit; src/modules/market/views/CheckoutPage.vue and order-placement flows likely need it.
  • Tasks — needs an audit; claim/complete actions should toast when unauth.

Acceptance criteria

  • Each module's primary write actions (post / vote / claim / buy / etc.) emit a toast when triggered by an unauth user, with an inline "Log In" action that pushes /login.
  • Toast strings live in i18n under <module>.auth.loginPrompt / <module>.auth.logIn (mirroring activities.favorites.loginPrompt).
  • Existing disabled-button states stay (toast complements them, doesn't replace).

Out of scope

  • The "operator-configurable public-vs-private" toggle is tracked separately (#TBD).
  • Wallet / chat / castle don't apply — they redirect to /login for everything (see commit 4605703).
The activities (events) module shows a friendly toast when an unauthenticated user lands on a route that needs an account, with an inline "Log In" action button that takes them straight to /login. This is the canonical pattern for our public-browsable modules and the other public modules should match. ## Canonical example `src/modules/activities/views/ActivitiesFavoritesPage.vue:30` ```ts onMounted(() => { if (!isAuthenticated.value) { toast.info(t('activities.favorites.loginPrompt'), { action: { label: t('activities.favorites.logIn'), onClick: () => router.push('/login'), }, }) } }) ``` ## Modules to audit - **Forum** — current state: vote, comment, and reply buttons just disable when `!isAuthenticated`. A first-time visitor taps a disabled button and gets no feedback. Add the toast on tap of any disabled write action (or on entering /submit while unauth — see `src/modules/forum/components/SubmissionRow.vue:127`, `SubmissionComment.vue:177-198`, `SubmissionDetail.vue:123-151`). - **Market** — needs an audit; `src/modules/market/views/CheckoutPage.vue` and order-placement flows likely need it. - **Tasks** — needs an audit; claim/complete actions should toast when unauth. ## Acceptance criteria - Each module's primary write actions (post / vote / claim / buy / etc.) emit a toast when triggered by an unauth user, **with an inline "Log In" action** that pushes `/login`. - Toast strings live in i18n under `<module>.auth.loginPrompt` / `<module>.auth.logIn` (mirroring `activities.favorites.loginPrompt`). - Existing disabled-button states stay (toast complements them, doesn't replace). ## Out of scope - The "operator-configurable public-vs-private" toggle is tracked separately (#TBD). - Wallet / chat / castle don't apply — they redirect to /login for everything (see commit 4605703).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/webapp#33
No description provided.