rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Refactor view resolver such it it enables passing a `ViewerContext` to `SpaceViewClass::default_query_range()`

Open abey79 opened this issue 1 year ago • 1 comments

#6917 could have been made much better if it was possible to pass ViewerContext and friends to SpaceViewClass::default_query_range(), thereby enabling the default visible time range to be derived from view properties.

Quoting that PR:

Note: this is a rather poor solution. Ideally, we would also have &ViewContext and friends, such that it would be possible to e.g. read view properties. This is however not possible because default_query_range() is called in a context where, all the way up in AppState, a ViewerContext is not available (precisely because it's being mutated). Improving on that would require a much more significant refactor. Passing the state at least allows ugly work around such as passing a value computed from e.g. SpaceViewClass:ui() (yes, ugly).

abey79 avatar Jul 16 '24 17:07 abey79

Albeit this still makes sense, the use-case I needed it for disappeared in #7071

abey79 avatar Aug 07 '24 14:08 abey79