Sync: open editors follow values stored elsewhere

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Read PenCatalogueSync, IDataProvider.QueryPensAsync, IPenCatalogueEditor.ReadAsync, AppSectionWatcher, and SettingsViewModel.FollowAppliedTheme, then review docs/architecture/overview.md for the current snapshot behavior. The issue requires coordinated changes to database reads, editor and settings reconciliation, and documentation; it is done when the listed acceptance cases pass and the overview describes the new behavior.

Written by the indexing model from the issue text.

Description

enhancement

Problem

A running viewer follows what other instances store, but only partly, and an open editor follows
none of it.

Stored Main window Open editor
Shown pen fields in semiplot_tags PenCatalogueSync, every 5 s, changed in place snapshot; re-read only on Refresh pen list
A pen's *_on_start read, changes nothing on screen by design snapshot
Group membership and group names read as strings in Pen.Groups snapshot
A semiplot_groups row's own columns not read: QueryPensAsync returns Pen only snapshot
app/theme AppSectionWatcher, applied live SettingsViewModel.FollowAppliedTheme
app/locale, all of connection/ read at start only snapshot; a save re-reads and writes only changed keys

The catalogue has two independent reads: the chart reads IDataProvider.QueryPensAsync, normalised;
the editor reads IPenCatalogueEditor.ReadAsync, as stored (PenCatalogue, StoredGroup). A group's
own column, such as folded_on_start (#139), never reaches the sidebar. An edit stored elsewhere
while the pen editor is open stays invisible there, and the next write of the same column overwrites
it without a word (docs/architecture/overview.md#the-pen-and-group-editor).

Rule

FollowAppliedTheme already does it for the theme: a field the operator has not touched follows the
stored value; a field the operator changed keeps its draft. Apply that to every stored value.

Proposal

  1. One read per source.
    • Database: PenCatalogueSync reads the full PenCatalogue once per ReadInterval. The chart
      takes the normalised Pen projection, the sidebar takes the groups, the editor takes the whole
      catalogue. The provider's normalisation becomes a pure mapping over the stored read; the start
      sequence reads the same statement.
    • Files: AppSectionWatcher watches connection/ as well as app/.
  2. The delta compares the whole catalogue: a changed group column is a change even when every pen
    is equal.
  3. The pen editor reconciles each read per field and never rebuilds a form.
    • A field with no draft and no queued write takes the stored value.
    • A field with a draft keeps it, as it does for the editor's own writes today.
    • Rows and groups join and leave by id; the selection stays.
  4. The settings dialog follows the same rule for every field, not only the theme.
  5. The main window keeps its current behaviour: shown fields change in place, *_on_start and
    folded_on_start apply only to what enters the window.

The database part and the settings part ship separately.

Acceptance

  • A pen field changed by another instance shows in an open pen editor within one read, unless that
    field holds a draft.
  • A draft survives a read that changes the same field elsewhere; its write then wins, as today.
  • A selected pen or group stays selected across a read that adds or removes another one.
  • A group column changed elsewhere reaches every running viewer within one read.
  • A connection/ key changed on disk shows in an open settings dialog unless the field holds a
    draft; the restart notice still governs when it takes effect.
  • docs/architecture/overview.md (the pen editor's snapshot rule, The live catalogue, The settings
    window) states the new behaviour.
Dominant language
C#
Stars
0
Forks
0
Avg merge
5m
Merged PRs (30d)
31

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Semiteq/SemiPlot

All issues in Semiteq/SemiPlot

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.