Page MenuHomePhabricator

Home - limit "status" queries to 100 and show 99+ if we hit that
ClosedPublic

Authored by btrahan on Dec 11 2014, 10:39 PM.
Tags
None
Referenced Files
F14047966: D10979.id26374.diff
Thu, Nov 14, 6:01 AM
F14013032: D10979.id26374.diff
Fri, Nov 1, 11:33 PM
F13987137: D10979.diff
Oct 21 2024, 7:40 AM
F13985771: D10979.id26362.diff
Oct 20 2024, 10:48 PM
F13973243: D10979.id26375.diff
Oct 18 2024, 12:02 AM
Unknown Object (File)
Oct 12 2024, 5:43 AM
Unknown Object (File)
Sep 30 2024, 7:12 PM
Unknown Object (File)
Sep 24 2024, 8:45 PM
Subscribers

Details

Summary

Fixes T6595. This diff has two issues as is... 1) the differential data fetching is pretty cheesey, but it looks like we can't just issue three separate databases to get the right data? 2) the translations break, since I am turning this into a string (and not an int) so the whole pluralization bit fails. I think 1 is okay as is and 2 needs to be fixed though I am not sure how to best do that...

Test Plan

loaded home page and it looked nice...!

Diff Detail

Repository
rP Phabricator
Branch
T6595
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 3242
Build 3248: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

btrahan retitled this revision from to Home - limit "status" queries to 100 and show 99+ if we hit that.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.

Oh, yuck. In theory, I think the translations have to go like this, ideally:

if ($count >= LIMIT) {
  $text = pht('99+ Things');
} else {
  $text = pht('%s Thing(s)', new PhutilNumber($count));
}

You could also do this:

$text = pht('(%d) %s Thing(s)', new PhutilNumber($count), $formatted_count);

...then translate it as just '%$2s Thing', '%$2s Thing(s)' -- i.e., discard the number in the output text. But this would be trickier for translators, and if there are any languages which have a noun form for "uncountably many things" or "a huge number of things" or similar, they wouldn't be able to use it with that approach. (I don't know if any such languages exist.)

src/applications/differential/application/PhabricatorDifferentialApplication.php
104

Maybe just do MAX_STATUS_ITEMS, and then if we hit the limit just render a single "99+ Active Reviews" bucket instead of breaking it up? I don't think the individual counts are too likely to be useful once you have 100+ of them, but I'm hesitant about showing an invalid number.

This revision is now accepted and ready to land.Dec 12 2014, 12:40 AM
btrahan edited edge metadata.
  • fix string construction, using a '%s things' if we hit limit and a '%d thing(s)' if we don't
  • provide two more translations that were shown missing in testing
  • refine differential to just say 'LIMIT-1+ Active Reviews' if we hit the limit there, else standard bucketing stuff
This revision was automatically updated to reflect the committed changes.