Page MenuHomePhorge

Query errors are displayed outside of viewport
Open, Needs TriagePublic

Description

  1. Go to http://phorge.localhost/maniphest/query/advanced/
  2. In the Query field, enter dfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjs dlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjd sflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslk dfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfj sdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflks djfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjsl kdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflksdjdsjfslkdfjslkdfjsdkfjdsflksdjfslkdfjsdlkfjsdflk and press the Enter key
  3. End up at the bottom of http://phorge.localhost/maniphest/query/DmOEm7_dt41q/#R (#R as PhabricatorApplicationSearchController calls PHUIObjectBoxView::setAnchor()) showing zero search results.
  4. Assume that my valid search terms had no matches, as the "Query Errors" message at the very top of the page isn't within my viewport. (I do not expect any user to realize that the No tasks found. or No results found for this query. message at the bottom is missing and to realize that they better manually scroll up.)

Currently Phorge decides to scroll down for me while Phorge show errors at the top, outside of my viewport (if you don't have a 500 inch screen).

Could maybe repeat the displayed error at the bottom (as I assume there should always be no results but is that also true for overheated queries?) but that's not great UX either.

Event Timeline

diff --git a/src/view/phui/PHUIObjectBoxView.php b/src/view/phui/PHUIObjectBoxView.php
index dce9d57568..13a0a3d061 100644
--- a/src/view/phui/PHUIObjectBoxView.php
+++ b/src/view/phui/PHUIObjectBoxView.php
@@ -318,6 +318,10 @@ final class PHUIObjectBoxView extends AphrontTagView {
       $lists,
       $this->table,
       $pager,
+      // When the anchor link scrolled us below the $showhide search parameters
+      // box, repeat the error message hidden and unseen at the top of the page
+      ($this->showHideOpen == true ? $this->formErrors : null),
       $this->renderChildren(),
     );

^ This would simply be ugly repeating of the error message below the search params box on http://phorge.localhost/maniphest/query/advanced/.
For testing the patch behavior with a results list, replace the line
($this->showHideOpen == true ? $this->formErrors : null),
with
($this->showHideOpen == true ? $header : null),