Skip to content

docs: Rewrite Settings and Workspaces documentation#9065

Merged
hl662 merged 39 commits into
masterfrom
nam/settings-workspace-docs
Apr 22, 2026
Merged

docs: Rewrite Settings and Workspaces documentation#9065
hl662 merged 39 commits into
masterfrom
nam/settings-workspace-docs

Conversation

@hl662

@hl662 hl662 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Rewrite and restructure Workspace & Settings learning docs

Rewrites the three linked learning docs (WorkspacesAndSettings.md, Workspace.md, Settings.md) and adds a one-page tutorial (WorkspaceTutorial.md) so the whole settings/workspace flow is simpler, beginner-friendly, and factually accurate.

Goals

  • Explain why workspaces and settings exist before diving into how
  • Give newcomers a clear path from concept → code
  • Fix factual errors and outdated API references
  • Add an end-to-end, user-friendly walkthrough of the full flow

Key changes

  • WorkspacesAndSettings.md — trimmed verbose sections, replaced sequence diagram with concise prose, and clarified the read/discovery vs write/create split for iTwin settings
  • Workspace.md — fixed incorrect claim that iModel.workspace auto-includes iTwin settings, added scope-bridging guidance
  • Settings.md — replaced deprecated IModelDb.saveSettingDictionary/deleteSettingDictionary guidance with EditTxn equivalents, clarified session-only vs persisted dictionaries, added close() notes, and documented the default single-container iTwin settings workflow
  • WorkspaceTutorial.md — added a one-page walkthrough that covers the end-to-end settings/workspace flow in a beginner-friendly format
  • Code examples — fixed wrong comments, added missing close() calls inside extract boundaries, restored accidentally removed extract, and tightened the advanced settings-container guidance
  • TSDoc — updated Settings class-level doc and addDictionary to reference current APIs

Validation

Targeted verification:

  • Reviewed the affected docs/snippets and API comments for consistency with the current getITwinWorkspace / saveSettingDictionary behavior
  • Fixed the invalid SettingsPriority.* links in the tutorial and verified the remaining touched markdown passes git diff --check

Known baseline issues:

  • None noted during this doc-only pass

- Add 'Schema validation behavior' subsection explaining lazy validation,
  no-op when no schema is registered, and type mismatch error behavior
- Add IModelHost.onAfterStartup example for schema registration
- Add 'Dictionary structure recommendations' subsection with naming
  conventions and organization guidance
- Expand 'Settings priorities' section with practical org/iTwin workflow
  and wire in Settings.addITwinDictionary / Settings.dropITwinDictionary
  extracts that were previously unused
- Add 'Persisted vs session-only dictionaries' comparison table under
  'iModel settings' explaining addDictionary vs saveSettingDictionary
- Add JSDoc cross-references between Settings.addDictionary and
  IModelDb.saveSettingDictionary

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hl662 hl662 force-pushed the nam/settings-workspace-docs branch from 4f17b0b to de4596b Compare March 5, 2026 18:04
@hl662 hl662 changed the title docs: Fill Workspace.md documentation gaps (#1927) docs: Fill Workspace.md documentation gaps Mar 5, 2026
hl662 and others added 8 commits March 5, 2026 13:07
…pace resources

- Add WorkspacesAndSettings.md: high-level overview with 4 Mermaid diagrams
  (architecture, runtime resolution sequence, priority stack, container discovery)
  reflecting actual shipped APIs (explicit containerId/priority, SettingsEditor
  for discovery, no CatalogDb)
- Add Settings.md: full Settings deep-dive (schemas, dictionaries, priorities,
  iModel settings, SettingsDb) with priority-stack Mermaid diagram; includes
  ⚠️ caution on iModel settings (saveSettingDictionary) advising SettingsDb
  for new work
- Rewrite Workspace.md: WorkspaceDb-only deep-dive with container hierarchy
  Mermaid diagram and links to overview and Settings.md
- Add JSDoc caution to IModelDb.saveSettingDictionary and deleteSettingDictionary
  pointing users to SettingsDb as the preferred approach
- Update cross-references: Preferences.md, NextVersion.md (#settingsdb link),
  and backend/index.md (new Workspaces and Settings section)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace bare `$backend` link target with the correct relative path `./Workspace.md`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two issues broke all affected diagrams:
1. `&quot;` HTML entities decoded to `"` by the doc pipeline before
   Mermaid runs, causing label parsing failures when a double-quoted
   label [\...\] contained decoded double quotes inside it.
   Fix: use single quotes in those label strings.

2. `\n` escape sequences in node labels are not valid Mermaid syntax.
   Fix: replace with `<br/>` which Mermaid supports for line breaks.

Files affected: WorkspacesAndSettings.md, Settings.md, Workspace.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…agram

Multi-line subgraph titles using <br/> cause Mermaid to missize the
header area, making the box border overlap the title text. Fix by
using single-line subgraph titles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Title 'CloudSqlite (shared infrastructure)' was too wide, causing
the subgraph border to clip through the label text. Shortened to
just 'CloudSqlite'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@johnnyd710 johnnyd710 mentioned this pull request Mar 24, 2026
hl662 and others added 5 commits April 6, 2026 11:44
…ace-docs

# Conflicts:
#	docs/changehistory/NextVersion.md
#	docs/learning/backend/Workspace.md
- Settings.md: consolidated all settings content (schemas, dictionaries,
  priorities, iTwin settings, iModel settings, SettingsDb) as single
  source of truth. Added iTwin settings section and expanded iModel
  settings with override/reference/pin subsections.

- Workspace.md: trimmed from 348 to 138 lines. Removed all settings
  content. Added 'Choosing the right workspace' decision guide near top
  with scope table (appWorkspace vs getITwinWorkspace vs IModelDb.workspace).

- WorkspacesAndSettings.md: added three-workspace scope table for the
  app/iTwin/iModel model introduced in PR #9116.

- Fixed cross-references: 5.8.0.md settingsdb link now points to
  Settings.md, NextVersion.md links to both Settings and Workspace docs.

- Verified all 28 code example includes appear exactly once (zero
  duplicates across files).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Hybrid SettingsDb/WorkspaceDb framing in Settings.md iTwin section
- Note in overview that diagram simplifies org/iTwin into one level
- Orientation block before iTwin settings (session-only vs persisted vs SettingsDb)
- Workspace.md title now 'Workspace Resources (WorkspaceDb)'
- Added plain-English heuristic to decision guide table
- Qualified 'workspace' as 'workspace scope' in key Settings.md passages
- Renamed '## Settings' to '## What is a setting?'
- Fixed awkward GeographicCRS link text
- Replaced 'Learn more' with 'Recommended reading order'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Create 5 extract markers referenced by docs/learning/backend/Settings.md
that were causing CI build failures:
- SettingsDb.discoverContainers
- SettingsDb.findContainers
- SettingsDb.createLocal
- SettingsDb.updateSetting
- SettingsDb.getSettings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread example-code/snippets/src/backend/WorkspaceExamples.test.ts Fixed
hl662 and others added 2 commits April 8, 2026 11:37
Replace fictional API names with actual public API names:
- SettingsEditor.* → WorkspaceEditor.*
- EditableSettingsCloudContainer.* → EditableWorkspaceContainer.*
- EditableSettingsDb.* → EditableWorkspaceDb.*
- SettingsDb.getSetting/getSettings → WorkspaceDb.getString
- Workspace.getSettingsDb → Workspace.loadSettingsDictionary
- GetSettingsDbArgs.priority → WorkspaceDbSettingsProps.priority

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflict in IModelDb.ts by keeping both the SettingsDb
recommendation notes from our branch and the @deprecated tags
from master directing users to EditTxn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
hl662 and others added 3 commits April 8, 2026 16:49
SettingsDb is an @internal type alias — it should not be exposed as a
user-facing concept. Replace all mentions with 'settings container'
(a WorkspaceDb in a container tagged containerType: 'settings').

Also addresses PR review feedback:
- Fix unused variable in snippet (#1)
- Fix inheritance claim in WorkspacesAndSettings.md (#2)
- Remove write lock claim and soften caution (#6, #7)
- Fix inheritance claim in Settings.md (#8)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update all 5 extract marker IDs and their corresponding [[include:]]
references in Settings.md to use SettingsContainer prefix instead of
SettingsDb, completing the terminology cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove duplicate WorkspaceDb.getString listing (there is only one
  getString method; no 'get all settings' method exists on WorkspaceDb)
- Fix createNewCloudContainer claim: containerType must be explicitly
  specified as 'settings' (default is 'workspace', not auto-tagged)
- Clarify write lock note: locks are independent because they are
  separate cloud containers, not because of a special settings lock

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread core/backend/src/workspace/Settings.ts Outdated
Comment thread core/backend/src/IModelDb.ts Outdated
Comment thread core/backend/src/IModelDb.ts Outdated
hl662 and others added 3 commits April 14, 2026 10:36
- Remove misleading 'Prefer SettingsDb' notes from IModelDb TSDoc
- Update Settings.ts class-level doc to reference EditTxn methods
- Fix Workspace.md table: IModelDb.workspace does not auto-include iTwin settings
- Trim WorkspacesAndSettings.md: lead with getITwinWorkspace, remove redundancy
- Add workspace.close() requirement note in Settings.md
- Add consume/load code for referencing iTwin settings from an iModel
- Clarify saveSettingDictionary vs WorkspaceEditor scope in Settings.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…clarity

- Replace IModelDb.saveSettingDictionary/deleteSettingDictionary refs with
  EditTxn equivalents (via withEditTxn) in Settings.md prose and inline code
- Add close() inside extract boundaries for GetITwinWorkspace,
  ReadITwinSettings, SaveTreeDbsToITwin, SaveITwinSettingsReferenceInIModel
- Add ReadITwinSettings extract with getNumber usage
- Fix wrong comment in QuerySettingDictionary extract ({min:8,max:10} -> {min:6,max:8})
- Add scope bridging note in Workspace.md explaining iModel.workspace
  does not auto-inherit iTwin settings
- Add containerType labels to mermaid diagram in WorkspacesAndSettings.md
- Add type annotation to inline getSetting<WorkspaceDbSettingsProps>
- Strengthen addDictionary session-only note in priority section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/learning/frontend/Preferences.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hl662 hl662 changed the title docs: Fill Workspace.md documentation gaps docs: Rewrite Settings and Workspaces documentation Apr 15, 2026
Comment thread docs/changehistory/5.8.0.md
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
hl662 and others added 8 commits April 15, 2026 16:31
Clarify that getITwinWorkspace is independent from appWorkspace/IModelDb.workspace
priority stack, addressing reviewer feedback on conflicting table description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The #settingsdb anchor no longer exists in Settings.md after the docs
rewrite. Updated to point to #settings-containers instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@johnnyd710 johnnyd710 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the documentation was easier to understand and flowed better when there was one document that went through a single user-story (LandscapePro). It only brought technical details when necessary. In general I find examples easier than concepts/diagrams but maybe that's just me

Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/Settings.md
hl662 and others added 4 commits April 17, 2026 15:23
Remove container types section, mermaid diagrams, container discovery.
Fix scope/priority wording and bootstrapping explanation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Create WorkspaceTutorial.md with 11-step LandscapePro narrative
- Add LandscapePro-specific iTwin persistence snippets
- Fix pre-existing SettingsDb test failure (missing containerType,
  improper db lifecycle with getEditableDb)
- Update overview reading order with tutorial callout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The SaveITwinSettingsReferenceInIModel snippet now clearly saves a floating
reference (no version field — follows latest). The VersionAndPinITwinSettings
snippet resolves each WorkspaceDb to its current version and bakes that exact
version into the saved reference, locking the iModel to that snapshot.

Updated tutorial Step 11 prose to explain the distinction and how to unpin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread example-code/snippets/src/backend/WorkspaceExamples.test.ts Outdated
Comment thread docs/learning/backend/Settings.md
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md
hl662 and others added 2 commits April 21, 2026 16:21
… snippets, simplify pin

- Remove 'How settings and resources connect' section (redundant)
- Remove mermaid priority diagram (inaccurate, low value)
- Remove 'Persisted vs session-only' subsection (repetitive)
- Extract DeleteIModelSettingDictionary and LoadITwinSettingsFromIModel snippets
- Simplify version pin snippet to use literal version string
- Move admin workflows under 'Advanced: managing settings containers'
- Fix mermaid diagram to include iTwin workspace scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Explain the read/write split for iTwin settings containers, document the single auto-discoverable container assumption, and fix the SettingsPriority links in the tutorial.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread core/backend/src/workspace/Settings.ts
Comment thread docs/learning/backend/Settings.md
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/Settings.md
Comment thread docs/learning/backend/Settings.md Outdated
Comment thread docs/learning/backend/WorkspacesAndSettings.md Outdated
Incorporate follow-up review feedback: add migration guidance for deprecated IModelDb settings APIs, improve the Settings introduction and startup guidance, and tighten overview wording.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept the last outstanding wording suggestion in Settings.md and update the PR description to call out the new one-page tutorial.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hl662 hl662 enabled auto-merge (squash) April 22, 2026 20:10
@hl662 hl662 merged commit 3575125 into master Apr 22, 2026
18 checks passed
@hl662 hl662 deleted the nam/settings-workspace-docs branch April 22, 2026 20:51
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.

5 participants