Import System
Import System
Covers the full import flow for bringing external markdown content into Inklings through the app’s import dialog. The user selects a source folder, reviews the preview analysis, chooses a conflict strategy, confirms the import, and observes the result in the sidebar. Tests verify what is visible and interactive in the UI rather than API response shapes.
Import operations create a new workspace from the source content. Each scenario should use a distinct source folder to avoid collisions between test runs.
Preconditions
- The app is open and at least one workspace is loaded
- Test fixture directories exist on the local filesystem at known paths (see Test Data section)
- The fixture directories must NOT contain an
inklings.dbfile (the app rejects such folders)
Scenarios
Seed: seed.spec.ts
1. Detect source type — plain markdown folder shows “Markdown Folder” in the import dialog
Open the import dialog and select a folder containing .md files but no .obsidian directory. Verify the dialog
identifies the source type correctly.
Steps:
- Open the Import dialog (via the File menu or the sidebar import action).
- Select or enter the path to the plain markdown fixture folder.
- Observe the source type label displayed in the dialog.
Expected: The dialog displays the source type as “Markdown Folder” (or equivalent label). No error or warning is shown. The dialog proceeds to the preview step.
2. Detect source type — Obsidian vault shows “Obsidian Vault” in the import dialog
Open the import dialog and select a folder that contains a .obsidian subdirectory. Verify the dialog identifies it as
an Obsidian vault.
Steps:
- Open the Import dialog.
- Select or enter the path to the Obsidian fixture vault.
- Observe the source type label displayed in the dialog.
Expected: The dialog displays the source type as “Obsidian Vault” (or equivalent label). The preview step becomes available.
3. Analyze import preview — file and folder counts are shown for a markdown folder
After selecting a markdown fixture folder in the import dialog, the preview panel should display the number of files and folders found.
Steps:
- Open the Import dialog.
- Select the markdown fixture folder.
- Wait for the preview panel to load.
- Observe the file count and folder count displayed in the preview.
Expected: The preview panel shows a file count of at least 1 and a folder count of at least 0. The source folder name appears as the preview title. The source type label reads “Markdown Folder”.
4. Analyze import preview — Obsidian vault shows wiki-link count in the preview
When an Obsidian vault containing [[wiki-link]] syntax is selected, the import preview should report the number of
wiki links that will be converted.
Steps:
- Open the Import dialog.
- Select the Obsidian fixture vault (which contains at least two pages with
[[PageName]]links). - Wait for the preview panel to load.
- Observe the wiki-link count displayed in the preview.
Expected: The preview panel shows a wiki-link conversion count of at least 1. The source type label reads “Obsidian Vault”.
5. Execute import — basic markdown folder completes and pages appear in sidebar
Select a small markdown fixture folder, configure the workspace, confirm the import, and verify the imported pages are visible in the sidebar.
Steps:
- Open the Import dialog.
- Select the markdown fixture folder.
- Enter a workspace name and target location.
- Review the preview (source type “Markdown Folder”, file count >= 1).
- Click “Import” (or “Confirm”) to start the import.
- Wait for the import to complete (the dialog closes or a completion indicator appears).
- Observe the sidebar page list.
Expected: At least one new page appears in the sidebar. The workspace name matches the configured name. No error message is displayed.
bridge:partial — No import progress steps are shown during the import. The UI moves directly from “Importing…” to the completion state. The test cannot assert intermediate phase transitions (Analyzing → Copying → Indexing → Complete).
6. Execute import — hierarchy preservation shows nested pages in sidebar
Import a fixture folder with a nested subdirectory structure and verify the page tree in the sidebar mirrors the folder hierarchy.
Steps:
- Open the Import dialog.
- Select the nested hierarchy fixture folder (which has
parent/child/grandchild.md). - Confirm the import with default settings.
- Wait for completion.
- Expand the page tree in the sidebar to reveal nested pages.
Expected: The sidebar shows a parent page containing a child page, which in turn contains “grandchild” as a nested page. The nesting depth and order matches the source folder structure.
bridge:partial — No progress events are shown. Hierarchy is visible in the sidebar after the import completes.
7. Execute import — Obsidian wiki-link conversion results in linked pages
Import an Obsidian fixture vault where one page links to another via [[PageName]] syntax. After import, the linked
page should be reachable via the converted link.
Steps:
- Open the Import dialog.
- Select the Obsidian fixture vault (which has
alpha.mdcontaining[[Beta]]andbeta.md). - Confirm the import.
- Wait for completion.
- Open the “alpha” page in the editor.
- Observe whether the
[[Beta]]reference appears as a resolved wiki-link (not a ghost/broken link). - Click the wiki-link and verify it navigates to the “beta” page.
Expected: The wiki-link in “alpha” resolves to “beta” and navigates successfully. No ghost-link styling is visible on the resolved link.
bridge:partial — No progress events. Wiki-link conversion is validated by observing the rendered link state in the editor.
8. Execute import — duplicate slug conflict with Skip strategy leaves existing page unchanged
When the workspace already contains a page with the same slug as an imported file, the Skip conflict strategy should leave the existing page untouched and report the skipped item.
Steps:
- Ensure the current workspace has a page with title “Hero” (slug
hero). - Open the Import dialog.
- Select the fixture folder containing
hero.md. - In the conflict strategy selector, choose “Skip” (or accept the default).
- Confirm the import.
- After completion, observe the import summary shown in the dialog or notification.
- Open the “Hero” page and verify its content has not changed.
Expected: The import summary shows at least 1 skipped file. The “Hero” page in the workspace retains its original content. No error is displayed.
9. Execute import — duplicate slug conflict with Rename strategy creates a renamed page
Same setup as scenario 8, but selecting the “Rename” conflict strategy should import the conflicting file under a suffixed name.
Steps:
- Ensure the workspace has a page with slug
hero. - Open the Import dialog.
- Select the fixture folder containing
hero.md. - In the conflict strategy selector, choose “Rename”.
- Confirm the import.
- After completion, observe the sidebar for a new page with a name like “Hero (1)” or “hero-1”.
Expected: A new page with a renamed slug (e.g., hero-1) appears in the sidebar. The original “Hero” page is
unchanged. The import summary shows 0 skipped files and at least 1 imported file.
10. Validate import path — non-existent path shows an error in the dialog
Attempt to enter a path that does not exist on the filesystem in the import dialog. The dialog should display a validation error rather than proceeding to the preview.
Steps:
- Open the Import dialog.
- Manually type or paste a path that does not exist (e.g.,
/tmp/does-not-exist-sentinel-qa). - Attempt to proceed to the next step.
Expected: The dialog displays a validation error indicating the path does not exist. The preview step is not shown. No import is started.
11. Validate import path — selecting a file instead of a directory shows an error
Attempt to select a single file (not a directory) as the import source. The dialog should reject this and display an appropriate error.
Steps:
- Open the Import dialog.
- Use the file picker to navigate to and select a single file (not a folder).
- Observe the dialog state.
Expected: The dialog displays a validation error indicating that a directory must be selected. The preview step does not appear.
12. Validate import path — existing Inklings workspace folder is rejected with an explanation
Attempt to import a folder that already contains an inklings.db file (an existing Inklings workspace). The dialog
should reject it with an explanation telling the user to open the workspace instead.
Steps:
- Open the Import dialog.
- Select or enter the path to an existing Inklings workspace folder (one that already contains
inklings.db). - Observe the dialog state.
Expected: The dialog displays an error such as “Source folder is already an Inklings workspace. Open it instead of importing.” The preview step is not shown.
13. Execute import — empty folder shows zero imported in the completion summary
Import a folder that exists on the filesystem but contains no markdown files. The import should complete without error but report zero pages imported.
Steps:
- Open the Import dialog.
- Select an empty temporary directory.
- Review the preview (file count shows 0).
- Confirm the import.
- Observe the completion summary.
Expected: The import completes without error. The completion summary shows 0 pages imported and 0 skipped. The app does not crash or display an error state.
14. Get supported import types — import dialog offers Markdown and Obsidian source options
The import dialog’s source type selector (or auto-detection) should support at least two source types: Markdown folder and Obsidian vault.
Steps:
- Open the Import dialog.
- Look for a source type selector or observe the auto-detected type options available.
Expected: The dialog indicates support for at least “Markdown Folder” and “Obsidian Vault” as import source types. Both labels are visible in the dialog.
15. Import records an event log entry for audit trail
When an import is executed, the event log records the import operation so users can see when content was imported and what changed.
Steps:
- Note the current state of the workspace (number of pages).
- Open the Import dialog and import a valid fixture folder.
- After the import completes, query the event log (via timeline or page events).
Expected: The event log contains at least one entry related to the import — either individual “Created” events for each imported page or a summary import event. The events have timestamps matching the import time.
bridge:partial — Event log queries are available via bridge, but the exact event structure for import operations should be confirmed from the first test run.
16. Execute import — large fixture set completes within a reasonable time and shows correct count
Import a fixture directory containing at least 50 markdown files. The app should handle the load without freezing or timing out, and the completion summary should report the correct count.
Steps:
- Open the Import dialog.
- Select the large fixture directory (50+
.mdfiles). - Confirm the import.
- Wait up to 60 seconds for completion.
- Observe the completion summary and the sidebar.
Expected: The import completes within 60 seconds. The completion summary shows at least 50 pages imported. The app remains responsive throughout. No error banner or crash dialog appears.
bridge:partial — No progress events. The test observes only the final completion state.
17. Copy mode import — creates a new workspace at a separate path, source folder is not modified
Use the Copy import mode to import a fixture folder into a new workspace directory, leaving the source folder intact.
Steps:
- Open the Import dialog.
- Select the markdown fixture folder.
- In the import mode selector, choose “Copy” and specify a new target path and workspace name (“Copied Workspace”).
- Confirm the import.
- After completion, verify the app opens the new workspace.
- Verify the source folder still exists and does not contain an
inklings.dbfile.
Expected: The new workspace named “Copied Workspace” opens and contains the imported pages. The source directory is
unmodified (no inklings.db added). The completion summary shows at least 1 page imported.
Test Data
| Key | Value | Notes |
|---|---|---|
| markdown_fixture_dir | /tmp/sentinel-qa-fixtures/markdown-basic | Must contain at least 3 .md files and 1 subdirectory |
| obsidian_fixture_dir | /tmp/sentinel-qa-fixtures/obsidian-vault | Must contain .obsidian/ directory and wiki-linked pages |
| nested_fixture_dir | /tmp/sentinel-qa-fixtures/nested-hierarchy | parent/child/grandchild.md structure |
| large_fixture_dir | /tmp/sentinel-qa-fixtures/large-import | 50+ .md files |
| temp_target_dir | /tmp/sentinel-qa-workspace-copy | Must not exist before the Copy mode test |
Notes
- bridge:partial applies to all import execution scenarios — no intermediate progress events are emitted. The UI jumps from the importing indicator to the completion state.
- The app validates that the source path is not already an Inklings workspace. Any fixture directory must be clean of
inklings.dbbefore each test run. - Fixture directories must be created as part of test setup (a
beforeAllhook in the generated.spec.tsfile is the right place). - Obsidian wiki-link conversion is only relevant for Obsidian vault imports; Markdown folder imports do not show a wiki-link count.
- The default hierarchy mode preserves nested directories as nested pages. A scenario for FlattenDeep mode could be added in a future revision.
Was this page helpful?
Thanks for your feedback!