Page MenuHomePhabricator

Make "Highlight As..." sticky across reloads in Diffusion and Differential
ClosedPublic

Authored by epriestley on Apr 17 2020, 8:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 2:01 AM
Unknown Object (File)
Sat, Apr 20, 5:13 PM
Unknown Object (File)
Mar 27 2024, 6:55 PM
Unknown Object (File)
Mar 26 2024, 3:36 AM
Unknown Object (File)
Mar 20 2024, 5:19 AM
Unknown Object (File)
Feb 16 2024, 7:19 PM
Unknown Object (File)
Feb 16 2024, 1:00 PM
Unknown Object (File)
Feb 4 2024, 12:05 AM
Subscribers
Restricted Owners Package

Details

Summary

Ref T13455. Add container-level storage for persistent view state, and persist "Highlight As..." inside it.

The storage generates a "PhabricatorChangesetViewState" configuration object as an output.

When preferences are expressed on a diff and that diff is later attached to a revision, we attempt to copy the preferences.

The internal storage tracks per-changeset settings, but currently always uses "last update wins" to apply the settings in the UI.

Test Plan
  • Viewed revisions, changed highlighting, reloaded. Saw highlighting stick in revision view and standalone view.
  • Viewed commits, changed highlighting, reloaded. Saw highlighting stick.
  • Created a diff, changed highlighting, turned it into a revision, saw highlighting persist.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a subscriber: Restricted Owners Package.Apr 17 2020, 8:16 PM

Since these may be prone to heavy usage with arguably minimal value for long-term persistence, you could consider a follow-up revision implementing DifferentialViewStateGarbageCollector.

I think this table won't grow too crazily fast, but it's easy and reasonable to GC so maybe I'll add a GC and just set the default policy to something fairly permissive like "365 days".

This revision was not accepted when it landed; it landed in state Needs Review.Apr 19 2020, 3:58 PM
This revision was automatically updated to reflect the committed changes.

I added a GC in D21164, with a default policy of "180 days".