Repository navigation
Make the incidents page friendlier for maintenance - #216
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The status enum overrides the timestamp-based resolved scope, causing completed maintenances to disappear from both Active/Upcoming and incident history.
3 open issues
What changed in this PR
Makes the Upright engine’s incident workflow friendlier for maintenance by consolidating event history and clarifying the creation form.
Changes:
- Moves filtered, paginated history to
/incidents, with Active and Upcoming sections above resolved events. - Adds time-zone labels and a current-time hint, and pauses automatic suggestions for new maintenance.
- Renames navigation to “Events” and adds integration coverage and changelog entries.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
test/integration/incidents/histories_controller_test.rb |
Tests the legacy redirect and allowed query parameters. |
test/integration/incidents_controller_test.rb |
Covers event sections, filters, navigation, and form markup. |
CHANGELOG.md |
Documents the maintenance workflow changes. |
app/views/upright/incidents/new.html.erb |
Renames the back link to “All events.” |
app/views/upright/incidents/index.html.erb |
Combines active, upcoming, and paginated historical events. |
app/views/upright/incidents/histories/show.html.erb |
Removes the separate history template. |
app/views/upright/incidents/edit.html.erb |
Renames the back link to “All events.” |
app/views/upright/incidents/_form.html.erb |
Adds zone labels, a time hint, and maintenance autofill controls. |
app/views/layouts/upright/_header.html.erb |
Renames the navigation link to “Events.” |
app/javascript/upright/controllers/suggestions_controller.js |
Pauses autofill conditionally and clears previously autofilled text. |
app/helpers/upright/incidents_helper.rb |
Supports conditional autofill and time-zone labels. |
app/controllers/upright/incidents/histories_controller.rb |
Redirects legacy history requests with permitted filters. |
app/controllers/upright/incidents_controller.rb |
Loads filtered event sections and paginated history. |
app/assets/stylesheets/upright/incidents.css |
Adjusts filter spacing and removes obsolete history styles. |
Review effort: Balanced
From a first run of maintenance pages in production: - The incidents page is now the history: every incident and maintenance by month, with the filters and the New incident and New maintenance buttons. /incidents/history redirects there, keeping its filters. - The header link reads Events, since maintenances aren't incidents. - The form labels its start and end times with the zone they're entered in, and shows the time in that zone now. - A new maintenance's title and first update start empty. Choosing its services filled them in with the last maintenance's text, which read as if the form had loaded someone else's maintenance. Incidents still autofill, and switching an incident to a maintenance clears what was filled in. The suggestions still open on focus.
Folding everything into one list by start time pushed a live incident below future maintenances, and could push it to a later page, and listed upcoming maintenances furthest first. Active and upcoming events now lead the page again, soonest maintenance first, with the filters applied to them too; the month-by-month history below holds what's resolved. Also: - The history redirect passes on only its filters, so a query key such as script_name can't steer it to another host. - The zone in a time's label is the zone at that time, not today's, so it stays right across a daylight saving change. - Switching to maintenance clears autofilled text before the suggestions load, so a failed request doesn't leave an incident's text behind. - Name what the tests check, not what used to happen.
lewispb
force-pushed
the
maintenance-page-tweaks
branch
from
November 11, 2026 10:03
d20c67d to
0b17bdf
Compare
The status enum's resolved scope (status = "resolved") replaces the lifecycle's timestamp scope, so a completed maintenance matched neither the Active, Upcoming nor history lists. The history now asks for resolved_at directly. The time labels name the app's zone, as UTC, rather than the abbreviation at the time in the field, which went stale once someone changed the dates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Four tweaks from a first run of maintenance pages in production.
Time.zone. A hint under Starts gives the current time in that zone when the page loads: "It’s 14:29 UTC now." I went with labels rather than a timezone picker./incidentsis now the history, with the type, service and search filters, and New incident and New maintenance buttons in the upper right. Active and Upcoming sections sit above the month-by-month list of resolved incidents and completed maintenances, so a live incident never sinks below future maintenances. Both sections follow the filters, and Upcoming is sorted soonest first./incidents/history301-redirects to/incidents, passing on onlykind,service,qandpage.autofillUnlessvalue (a CSS selector), and the new form passes#kind_maintenance:checked. Autofill pauses for maintenances, and switching from Incident to Maintenance clears any text autofill put there. Suggestions still open on focus, and incidents autofill as before. A blank first update still saves as "Maintenance scheduled.", which keeps internal services off the public page.CHANGELOGis updated under Unreleased → Changed.Testing
The pausing and clearing of autofill is untested: the repo has no JS or system test harness, and I haven't tried it in a browser. It needs a manual check, please.
New integration tests cover the page sections and their order, the buttons, the filters, the redirect (including that it drops unknown keys such as
script_name), the zone labels and hint, and the autofill attribute on the maintenance form.bin/rails testpasses except three Playwright probe tests, which fail locally because Chromium isn't installed on this machine and fail the same way onmain. Rubocop and Brakeman are clean.