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
F18740122: D21137.diff
Thu, Oct 2, 12:41 AM
F18735839: D21137.id50334.diff
Wed, Oct 1, 3:32 AM
F18624532: D21137.diff
Sep 15 2025, 8:22 PM
F18618667: D21137.diff
Sep 15 2025, 12:40 AM
F18612715: D21137.diff
Sep 14 2025, 9:49 AM
F18436754: D21137.id.diff
Aug 31 2025, 11:25 AM
F18426798: D21137.diff
Aug 30 2025, 11:18 PM
F18379273: D21137.id50334.diff
Aug 28 2025, 3:44 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".