Skip to content

Fix #7442: REST collections, ResourceEditor, Clear response#88

Merged
Panthevm merged 1 commit into
masterfrom
7442-new-ui-issues
May 22, 2026
Merged

Fix #7442: REST collections, ResourceEditor, Clear response#88
Panthevm merged 1 commit into
masterfrom
7442-new-ui-issues

Conversation

@Panthevm
Copy link
Copy Markdown
Collaborator

Addresses items from HealthSamurai/sansara#7442.

Summary

Collections sidebar

  • New top-level "Create" button — copies the active tab into a fresh collection.
  • Save now resolves the snippet by tab.historyId ?? tab.id and binds the editor tab to the snippet id, so subsequent edits update the existing sidebar entry (the sidebar method/path now updates after Save, no more orphaned duplicates).
  • Rename via the row menu: deferred startRenaming (the dropdown no longer steals focus and aborts the rename); folders are force-expanded before rename so children stay visible; stopPropagation on the menu item click.
  • Rename input: onBlur commits non-empty values via tree.completeRenaming() and reverts empty input via tree.abortRenaming() (instead of always aborting on click-outside).
  • TreeView remounts on data update so saved edits show up immediately; folder collapsed state is carried over to the new title on rename so closed folders stay closed.

ResourceEditor

  • Propagates resourceType to HSComp.CodeEditor as resourceTypeHint through EditTabContentEditorTab. FHIR validator now resolves the StructureDefinition correctly and stops marking valid properties (e.g. nested extension) as "Unknown property".

REST response panel

  • New "Clear response" button (X) at the right edge of the response header — deletes the stored response for the current tab; the pane falls back to the empty "No response yet" placeholder.

Out of scope

  • Item 5 ("pagination without total") — to be addressed separately.

Test plan

  • Collections: create a request → click "Create" → new collection appears with the active tab inside.
  • Collections: load a saved snippet → change method → Save → sidebar item method updates in place (no duplicate row).
  • Collections: collapse a folder → rename it from the row menu → folder stays collapsed; children are not visible after rename.
  • Collections: rename a snippet → click outside the input → name commits; rename then clear input → click outside → name reverts.
  • ResourceEditor: open a Patient or other resource with extension nested inside a backbone (e.g. identifier[].extension) → no "Unknown property" diagnostic.
  • REST: send a request, get a response → click the X button at the far right of the response header → response is cleared, pane shows "No response yet".

Collections sidebar (issue #7442):
- Add a top-level "Create" button to create a new collection (copying
  the active tab).
- Save now resolves the snippet by tab.historyId ?? tab.id, then binds
  the editor tab to that snippet so subsequent edits update the same
  sidebar entry instead of creating a new one.
- Rename via the row menu: defer startRenaming via setTimeout(0) so the
  dropdown finishes closing before focus moves into the input;
  stopPropagation on the menu item click; force-expand folders before
  rename so the children stay visible during editing.
- Rename input: onBlur commits non-empty values via tree.completeRenaming
  and reverts empty input via tree.abortRenaming instead of always
  aborting.
- Restore TreeView remount on data update so saved edits (e.g. method
  change) are reflected immediately; carry collapsed folder ids over to
  the new title on folder rename so closed folders stay closed.

ResourceEditor:
- Propagate resourceType down to HSComp.CodeEditor as resourceTypeHint
  through EditTabContent and EditorTab so the FHIR validator can resolve
  the StructureDefinition and stops marking valid properties (e.g.
  nested extension) as "Unknown property".

REST response pane:
- Add a Clear response button (X) that deletes the stored response for
  the current tab; pane falls back to the empty "No response yet"
  state.
@Panthevm Panthevm merged commit 912ea38 into master May 22, 2026
4 checks passed
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.

1 participant