johnwdubois / rezonator

Rezonator: Dynamics of human engagement
35 stars 2 forks source link

Layers #1460

Open johnwdubois opened 3 months ago

johnwdubois commented 3 months ago

Goals

What to do

  1. Each (relevant) Tab in Rezonator should display a colorful button on the header bar, labeled "Layer".
  2. Next to the button, a field displays the name of the currently Active layer.
  3. The Active layer is the only layer that can be:
    • shown on the screen
    • edited
    • updated/saved
  4. Clicking the Layer button show a drop-down list of existing Layers to choose the Active layer from, plus the option to create a new Layer (which will automatically become the Active layer).
  5. Every Tab begins with its Active layer being the Default layer. The Default layer is automatically created whenever Rezonator is used, even if the user takes no special action. (It is equivalent to the data that already exists in the current Rezonator, for a given tab.)
  6. Users can select exactly one layer of each type to be Active at any time.
  7. When the user selects a layer that is different from the current layer
    • any changes to the previously Active layer are saved in a "save file" (actually, in a node map whose root represents a certain layer of a certain Tab)
    • the new Active layer is “loaded”.
  8. “Loading” a new Active layer involves...
    • each token and unit "forgets" what entries and chains it was part of in the previously Active layer
    • each token and unit is "told" what entries and chains it is now part of, based on the newly activated Active layer
  9. Relevant tabs that should have layers:
    • [x] Trail (This may be the easiest place to start)
    • [x] Stack (done, basically [= "Stacking"]
    • [x] Tree
    • [x] Resonance
    • [x] Clique (This Tab is tied to Resonance, and is not independent of it.)
    • [ ] Chunk

See also

462

1283

1397

985

kayaulai commented 3 months ago

I'm not sure it's a good idea to have unit layers - If only one layer can be visible at a time, that means part of the lines will always been invisible, which isn't quite intended behaviour!

johnwdubois commented 3 months ago

Good point about the unit layer -- I have removed it from the list.

kayaulai commented 1 month ago

One thing that needs to be decided from the start is how to implement chunk layers properly, because we don't want a situation where

  1. A user creates a chunk in Chunk Layer 1 which is also a track belonging to Trail Layer 2
  2. The user switches to Chunk Layer 2
  3. Now tracks in Trail Layer 2 are gone.

There are several options:

  1. Scrap the idea of chunk layers, and instead do chunk colouring: https://github.com/johnwdubois/rezonator/issues/1355
  2. Each trail layer has to be associated with a chunk layer. This can be a many-to-one relationship, i.e. one trail layer can correspond to multiple chunk layers, but not the other way around.
  3. Each trail layer has to be assoiated with one chunk layer and the relationship has to bijective: One trail layer corresponds to exactly one chunk layer. I'm not a fan of this one as it would create the need to create redundant chunks in many cases. However, it's probably easier to implement than option 2.

(Everything said here applies to rez as well.)

terrydubois commented 1 month ago

Current bugs with resonance layers:

terrydubois commented 1 month ago

When deleting a token, the token must be removed from all chains that it is in across all layers. If the user attempts to delete a token that is in 1+ chains of an inactive layer, we should show a dialog box (similar to the chunk dialog box for this issue) asking user if they want to remove this token from all chains that it is in.

terrydubois commented 1 month ago

Default layers should not use the ID "Default". Instead, when starting a new REZ file, spawn a default layer map with a random ID, similar to any other layer.