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
F13325577: D21137.diff
Sat, Jun 15, 2:01 AM
F13313072: D21137.diff
Tue, Jun 11, 7:26 AM
F13305707: D21137.id50348.diff
Sun, Jun 9, 12:08 AM
F13299726: D21137.diff
Fri, Jun 7, 8:22 AM
F13281434: D21137.diff
Sun, Jun 2, 10:48 AM
F13269951: D21137.diff
Wed, May 29, 8:20 AM
F13268909: D21137.diff
Wed, May 29, 5:30 AM
F13257253: D21137.id50334.diff
Sat, May 25, 9:57 PM
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".