0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 06:24:48 +08:00
discourse/app/models/concerns
chapoi bf0128fa86
UX: Trust level section functional redesign (#41231)
The engagement dashboard's "Trust level pipeline" showed each level's
membership
plus direction-blind "moves in / moves out" counts, colored by
**position**
(in vs. out). That mislabeled healthy movement: a member graduating
*out* of Tiers, especially New,
rendered as a red ↓, reading as negative when it's the best possible
outcome.

This PR reframes the widget as a **directional arrivals funnel** with a
focus on the flow, and specifically looks at promoted/demoted-in
  
  ## Design thinking

- **Direction, not position.** Trust-level movement has a meaningful
axis —
up (promotion) is good, down (demotion) is not. We split every move into
`promoted_in` and `demoted_in`, drop the double bars, and colour by
direction: if more promotions => green, if more demotions => red.
Leaving New is now correctly green.
- **An "arrivals" funnel.** Each rung answers one consistent question:
*how many
members arrived here this period?* For every bar it's tracked the same
way + we add an extra label for the tier that is set as the `Default
trust level`.
- **Sign-ups ≠ promotions.** Signups are excluded from both the trend
and the bar scale. It's volume would otherwise often dwarf the other
bars.

  ## Backend — `reports/trust_level_pipeline.rb`

- **Snapshot** per level: `User.real.group(:trust_level).count` + share.
No date
    filter — it's the current distribution, not a period metric.
- **Directional arrivals** from `user_histories` (`change_trust_level` +
    `auto_trust_level_change`) within the period: `promoted_in`,
    `demoted_in` per level.
- **Sign-ups**: real users created in the period, attributed to the
entry level
(`SiteSetting.default_trust_level`). Not counted as trust-level moves.
- **Trend** (`prev_period`): net = promotions − demotions across the
ladder
    (sign-ups excluded) → `climbing` / `dropping` / `stable`.

## Known limitation
  
The `Default invitee trust level` is not taken into account, which means
invitees can be counted at the wrong rung.
However, accounting for it correctly means distinguishing invited from
organic sign-ups (joining through invites, and handling that a user's
trust level may have moved since they joined), which introduces a second
entry point. That breaks the widget's core simplification and adds
complexity. Overall I'm expecting the % of invitees to usually not
meaningfully muddle the representation of the pipeline flow.
2026-07-02 13:31:28 +08:00
..
reports UX: Trust level section functional redesign (#41231) 2026-07-02 13:31:28 +08:00
acl_target.rb DEV: Add banned_acl concept to AccessControlList (#41254) 2026-06-29 16:22:30 +10:00
anon_cache_invalidator.rb
cached_counting.rb DEV: Upgrade the Redis gem to v5.4 2025-03-19 14:34:00 +01:00
category_hashtag.rb DEV: Replace Ruby numbered parameters by it where applicable (#37810) 2026-02-13 13:59:07 +01:00
custom_field.rb
has_custom_fields.rb DEV: Enable some minor rubocop rules (#40094) 2026-05-19 15:29:38 +02:00
has_deprecated_columns.rb
has_destroyed_web_hook.rb DEV: Enable some minor rubocop rules (#40094) 2026-05-19 15:29:38 +02:00
has_nested_reply_stats.rb FEATURE: Allow editing a post's reply target from the composer (#39471) 2026-04-29 12:23:26 -03:00
has_post_upload_references.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
has_sanitizable_fields.rb
has_search_data.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
has_url.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
limited_edit.rb
locale_matchable.rb DEV: Use localizable concerns across post, topic, categories (#34137) 2025-08-07 22:12:01 +08:00
localizable.rb FEATURE: Localize local oneboxes (#40493) 2026-06-08 11:49:55 +08:00
positionable.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
reviewable_action_builder.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
roleable.rb SECURITY: Signup-time primary_group_id assignment grants whisperer access 2026-06-30 16:10:52 +02:00
searchable.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
second_factor_manager.rb DEV: Split passkey and security key WebAuthn ceremonies for 2FA (#40817) 2026-06-17 12:52:47 -03:00
stats_cacheable.rb
topic_tracking_state_publishable.rb
trashable.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00