dproofreaders icon indicating copy to clipboard operation
dproofreaders copied to clipboard

Revisit the new user experience

Open cpeel opened this issue 2 years ago • 2 comments

In an attempt to help a new user navigate the site, the code shows, or hides, information based on the number of pages the user has proofread in P1 (technically the ELR -- entry level round -- but I'll use P1 in this issue). While the logic to get the number of P1 pages is centralized (get_pages_proofed_maybe_simulated()), how this is used as a threshold varies pretty widely.

These are the current thresholds, what happens at them and on what pages:

>= 10

  • will show random rule -- round page

>= 15 && < 200

  • will ask proofreaders about their mentor feedback -- activity hub & round page

> 20

  • will show release queues -- round page
  • will show filter block -- round page
  • will show filtered projects on progress snapshot -- activity hub
  • will show filtering links on progress snapshot -- activity hub

> 80 && <= 100

  • will show message about simple proofreading rules going away soon -- round page

< 100

  • will show the string "Activities" in the navbar before the list of activities -- navbar
  • will show user block to point them to P1 -- search page
  • will show user block telling them to read project comments and hit start proofreading -- project page

<= 100

  • will show simple proofreading rules -- round page
  • will redirect user to ELR or tell them to select a beginner project -- activity hub & round page

< 300

  • will tell a user about an unread PM -- activity hub & round page

<= 300

  • will show beginner help in progress snapshot -- activity hub

Note that a proofreader needs to proof 300 pages in P1 before being eligible for P2, that's presumably where the 300 is from, but they are defined in two separate places.

We should -- at a minimum -- standardize on 3 or 4 standard cutoffs, eg: 50, 100, 300.

What would be better is if we conceptualized what it is we're trying to do here and create some centralized code that implements it. For instance, perhaps we break the new-user experience down into 3 levels that they "graduate" from:

  1. guided steps through the site
  2. simple versions of certain information or excluding some information
  3. final last few things before we stop treating them as a beginner

We could then have functions that do gradual reveals map to one of those levels and a centralized function that can accept a query with a level and return true/false if the user is in that level. Then we have one place we can define what those levels are.

A more concrete example:

# in gradual.inc
function user_is_tenure_level($level, $username = null)
{
    if ($username === null) {
        $username = User::current_username;
    }

    $LEVEL_BREAKPOINTS = [
        "guided" => 50,
        "simple" => 100,
        "final" => 300,
    ];

    $pages = get_pages_proofed_maybe_simulated($username);
    return $pages <= $LEVEL_BREAKPOINTS[$level];
}

# and used like
function thoughts_re_mentor_feedback($pagesproofed)
{
    if (user_is_tenure_level("final")) {
        echo "<p>";
        echo sprintf(_("New Proofreaders: <a href='%s'>What did you think of the Mentor feedback you received?</a>"), get_url_to_view_topic(6651));
        echo "</p>";
    }
}
# in actuality, the above really needs to be pulled into pgdp-production since
# it goes to a hard-coded topic that only works on pgdp.net

Another approach could be to make it category-based rather than level-based. Regardless we should think about how to standardize these thresholds and centralize where they are defined.

cpeel avatar Dec 25 '23 01:12 cpeel

FWIW, here are the places where the gradual-reveal bits are called or the number of pages used explicitly.

activity_hub.php

alert_re_unread_messages($pagesproofed);

welcome_see_beginner_forum($pagesproofed, $round->id);

thoughts_re_mentor_feedback($pagesproofed);

// Proofreaders with fewer than 21 pages can't see the filter box on the Round
// pages so prevent those users from selecting the filtered option.
if ($pagesproofed <= 20) {
    $show_filtered_projects = false;
    $show_filtering_links = false;
}

if $pagesproofread < 300
    $show_beginner_help in progress_snapshot_table()

tools/proofer/round.php

alert_re_unread_messages($pagesproofed);

welcome_see_beginner_forum($pagesproofed, $round->id);

encourage_highest_round($pguser, $round->id);
if ($pagesproofed <= 100 && $ELR_round->id == $round_id) {
    if ($pagesproofed > 80) {
        echo "<p class='small italic'>";
        // TRANSLATORS: Simple Proofreading Rules are the strings listed in pinc/simple_proof_text.inc
        printf(
            _("After you proofread a few more pages, the following introductory Simple Proofreading Rules will be removed from this page. However, they are permanently available <a href='%s'>here</a> if you wish to refer to them later. (You can bookmark that link if you like.)"),
            "$code_url/faq/simple_proof_rules.php"
        );
        echo "</p>";
    }

    include($relPath.'simple_proof_text.inc');
}
if ($rule && $pagesproofed >= 10) {
    echo "<h2>";
    echo _("Random Rule");
    echo "</h2>";
    ...
}
thoughts_re_mentor_feedback($pagesproofed);
if ($pagesproofed > 20) {
    // Link to queues.
    echo "<h2>", _('Release Queues'), "</h2>";
    $res = DPDatabase::query("
        SELECT COUNT(*)
        FROM queue_defns
        WHERE round_id='{$round->id}'
    ...
}
// Don't display the filter block to newbies.
$show_filter_block = ($pagesproofed > 20);

show_projects_for_round($round, $show_filter_block);

pinc/gradual.inc

welcome_see_beginner_forum():

    } elseif ($pagesproofed <= 100) {
        // direct user to ELR page or, of there, tell
        // them to select a BEGINNER ONLY project
    }
function thoughts_re_mentor_feedback($pagesproofed)
{
    if ($pagesproofed >= 15 && $pagesproofed < 200) {
        echo "<p>";
        echo sprintf(_("New Proofreaders: <a href='%s'>What did you think of the Mentor feedback you received?</a>"), get_url_to_view_topic(6651));
        echo "</p>";
    }
}
function alert_re_unread_messages($pagesproofed)
{
    global $pguser;

    if ($pagesproofed < 300) {
        $numofPMs = get_number_of_unread_messages($pguser);
        if ($numofPMs > 0) {
            echo "<div class='callout'>";
            echo "<div class='calloutheader'>";
            echo _("You have received a private message in your Inbox.");
            echo "</div>";
            ...
        }
    }
}
function maybe_output_new_proofer_message()
{
    global $code_url, $ELR_round;

    // Help direct new proofers to projects to proof.
    $pagesproofed = get_pages_proofed_maybe_simulated();
    if ($pagesproofed < 100) {
        echo "<div class='callout'>";
        ...
    }
}
function maybe_output_new_proofer_project_message($project)
{
    // if not approved for ELR, shows criteria, else:
    } elseif ($pagesproofed < 100) {
        // tells them to read project comments and hit start proofreading
}
function encourage_highest_round($username, $round_id = null)
{
    // not based on pages proofread
}

pinc/theme.inc

function html_navbar()

        if (get_pages_proofed_maybe_simulated() < 100) {
            $activities_string .= "<span class='text'>" . _("Activities") . ": </span>";
        }

tools/search.php

maybe_output_new_proofer_message()

project.php

maybe_output_new_proofer_project_message()

cpeel avatar Dec 25 '23 01:12 cpeel

After #1011, these are the current thresholds:

>= 10

  • will show random rule -- round page

>= 20 && < 300

  • will ask proofreaders about their mentor feedback -- activity hub & round page

>= 20

  • will show release queues -- round page
  • will show filter block -- round page
  • will show filtered projects on progress snapshot -- activity hub
  • will show filtering links on progress snapshot -- activity hub

> 80 && < 100

  • will show message about simple proofreading rules going away soon -- round page

< 100

  • will show the string "Activities" in the navbar before the list of activities -- navbar
  • will show user block to point them to P1 -- search page
  • will show user block telling them to read project comments and hit start proofreading -- project page
  • will show simple proofreading rules -- round page
  • will redirect user to ELR or tell them to select a beginner project -- activity hub & round page

< 300

  • will tell a user about an unread PM -- activity hub & round page
  • will show beginner help in progress snapshot -- activity hub

cpeel avatar Jan 12 '24 20:01 cpeel