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
F15443061: D21137.id50348.diff
Thu, Mar 27, 2:01 AM
F15436253: D21137.id.diff
Tue, Mar 25, 12:55 PM
F15433926: D21137.diff
Tue, Mar 25, 1:14 AM
F15431260: D21137.diff
Mon, Mar 24, 11:23 AM
F15421509: D21137.id50334.diff
Sat, Mar 22, 12:26 AM
F15396791: D21137.diff
Sun, Mar 16, 4:19 PM
F15391266: D21137.diff
Mar 15 2025, 9:07 AM
F15305368: D21137.id.diff
Mar 6 2025, 2:50 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".