-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link "skip empty diffs" with "without formatting" #1114
base: master
Are you sure you want to change the base?
Link "skip empty diffs" with "without formatting" #1114
Conversation
@@ -172,6 +172,42 @@ function copyToClip(textstring) { | |||
echo $navigation_text; | |||
} | |||
|
|||
// Load an associative array for which pages in the project have diffs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're trying to get better about this could we add
/**
* @return array<string, array<string, mixed>>
* Return an associative array indexed by page image name, where each page has an array of attributes.
*/
function load_page_diff_array(Project $project, Round $L_round, Round $R_round, bool $include_no_format = false): array
while ([$this_val, $this_user, $is_empty_diff] = mysqli_fetch_row($res)) { | ||
foreach ($diff_array as $this_val => $diff_record) { | ||
$this_user = $diff_record["username"]; | ||
$is_diff = $format == "remove" ? $diff_record["is_diff_without_formatting"] : $diff_record["is_diff"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wanted to be slightly cleverer you could push the ternary inside the index:
$is_diff == $diff_record[$format == "remove" ? "is_diff_without_formatting": "is_diff"];
or
$idx = $format == "remove" ? "is_diff_without_formatting": "is_diff";
$is_diff = $diff_record[$idx];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested between P3 and F1, but probably a better time to use it is between F1 and F2, to see if F1 has made incorrect proofreading changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested a few pages and works well.
When users are comparing diffs without formatting they expect "skip empty diffs" to skip pages that only differ by formatting. This links the two together so that it behaves the way that expect.
04e2468
to
6b24b2c
Compare
Just rebased this branch and updated the sandbox. This PR is being held until until we iron out if it's going in or not. |
When users are comparing diffs without formatting they expect "skip empty diffs" to skip pages that only differ by formatting. This links the two together so that it behaves the way that expect. Task 2000.
Sandbox: https://www.pgdp.org/~cpeel/c.branch/navigate-without-formatting/