Skip to content

Addressing #1670: Settings reset upon new files only if the fields are incompatible#1683

Open
glstott wants to merge 6 commits into
CDCgov:devfrom
glstott:1670
Open

Addressing #1670: Settings reset upon new files only if the fields are incompatible#1683
glstott wants to merge 6 commits into
CDCgov:devfrom
glstott:1670

Conversation

@glstott

@glstott glstott commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

This addresses bug #1670.

I've implemented a fix so that adding/removing files no longer resets user settings. Now, settings are reset when starting a new session or when a setting requires a field no longer included in the dataset. If a file is replaced with a compatible one, settings will stay. If a file is deleted that is needed, the setting will reset.

In the future, users may want an undo button, so I'll add a new issue to keep track of this ask.

Summary

  • Preserved analysis settings across file add/remove updates by keeping resetData() data-only.
  • Added compatibility cleanup function so field-backed settings only persist when their selected field still exists in the updated dataset. Any incompatible field-backed settings are then reset.
  • Kept compatible settings intact, including fixed scalar styling like custom node color.
  • Synced MicrobeTrace component state and GlobalSettingsModel after compatibility cleanup so stale UI selections are not re-applied.
  • Updated file removal behavior to avoid resetting settings when all files are deleted; the launch button is disabled until files are added again.
  • Added Cypress regression coverage for:
  • preserving fixed node color across file updates,
  • preserving shape-by when a replacement node file still has the selected field,
  • resetting shape-by when the selected field disappears,
  • preserving settings after all files are removed.

Verification

  • npx.cmd ng build --configuration development --watch=false
  • cypress/e2e/ingestion/files-ui.cy.ts: 13 passing.

glstott and others added 4 commits June 1, 2026 14:19
…ded regression tests to check for custom node color preserved upon file changes.
…d is still exists before resetting the setting that uses it.

So if a user deletes a node file with "state" and adds a node file with "state", if coloring of nodes used state, it will stay. If a user deletes this file, but doesn't add a replacement, it will then reset that setting.
# Conflicts:
#	cypress/e2e/ingestion/files-ui.cy.ts
@dacowan404

Copy link
Copy Markdown
Collaborator

I think this needs revisiting. It addresses the issue but reintroduces another one.
When users load a complete new dataset the variables reset if the field isn't found in the new dataset (ie. new dataset doesn't have state). However if the new dataset does have that field then it doesn't reset it. For instance, the default dataset has node color by variable set to State, if the new dataset has a state field it will use that to color the nodes. My understanding is that these should all be reset to None for a new dataset (except for Link Color By which should default to origin).

@glstott

glstott commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

Ok! I can remove that part. It was an intentional choice because they said it should reset only when a user starts a new session, not when deleting or adding files to the same session.

@dacowan404

Copy link
Copy Markdown
Collaborator

Maybe we should add it to discussion for the meeting tomorrow. In my view, removing all the files would constitute the start of a new session, but maybe they have a different view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants