lgessler / glam

(WIP) a webapp for language documentation
Eclipse Public License 2.0
40 stars 3 forks source link

Move editor configuration out of core DB code and into UI #27

Closed lgessler closed 9 months ago

lgessler commented 9 months ago

Motivation

If a UI needs to know some information about a particular layer, it needs to be configured somewhere. For the interlinear UI, this happens inside core database code.

This is undesirable, because it requires the core database code to be changed for every new UI, since it is not possible to anticipate what exactly a UI might want to know about each layer.

Proposed Feature

The backend should give a generic mechanism for updating configuration info. Probably the right thing to do is to give each layer item a config attribute which holds arbitrary key-value pairs for each UI. For example, if the interlinear UI wanted to indicate that a span is token-anchored rather than sentence-anchored, then it would look like this:

{:span-layer/id     '...
 :span-layer/config {"interlinear" {:anchoring "token"}}}

This allows UIs to add arbitrary new key-value pairs without requiring code changes to the backend.

Some open questions:

  1. Should the UI supporting setting these values be in the document or the project?
  2. Should the permissions required for changing this be admin or writer level?

Probably my answers would be (1) project, and (2) admin.

Alternatives

None