Skip to content

Feat/html edit#726

Merged
linonetwo merged 26 commits into
masterfrom
feat/html-edit
Jun 25, 2026
Merged

Feat/html edit#726
linonetwo merged 26 commits into
masterfrom
feat/html-edit

Conversation

@linonetwo

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 13:00
Comment thread src/services/htmlWiki/htmlFileIO.ts Fixed

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI 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.

Pull request overview

Copilot reviewed 74 out of 75 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread src/services/workspaces/getWorkspaceMenuTemplate.ts
Comment thread src/windows/AddWorkspace/useOpenHtmlWiki.ts Outdated
Comment thread src/windows/GitLog/useGitLogData.ts Outdated
Comment thread src/windows/GitLog/__tests__/workspaceGitScope.test.ts Outdated
Comment thread scripts/run-e2e.ts
linonetwo added 21 commits June 25, 2026 16:41
Introduce WorkspaceType.html, htmlFileLocation on IWorkspace, and path/git-scope utilities. Sanitize and create flows skip tidgi.config for HTML workspaces.
Strategy pattern isolates folder vs single-file HTML startup, HTTP routing, and git scope resolution.
Route GET/PUT through workspace strategies, start HTML HTTP server instead of wiki worker, and delegate stopWiki to HtmlWiki.
Add gitScope helpers, scoped commit/log for HTML workspaces, and GitLog filtering by workspace file path.
Open HTML file from Add Workspace, filter edit sections by type, show HTML path, optional file deletion, and workspace menu support.
English and Simplified Chinese strings for open HTML file, settings labels, and delete confirmations.
Cover path/git scope, registry filtering, scoped git ops, GitLog scope, and Cucumber scenarios for add workspace and git log isolation.
…tercept


Inject TiddlyFox-style saver bootstrap into served HTML wikis and bridge saves
through IPC instead of triggering browser downloads.
Force HTML workspaces to standalone mode and hide advanced main/sub options
in the import dialog.
Generate blank HTML via tiddlywiki CLI and exercise real UI save flow with
active workspace view targeting.
Replace in-step dugite mobile simulation with a separate Node mock server so
sync E2E exercises the same network boundary as a real mobile client.
Remove the mock mobile Git HTTP server from Desktop E2E so NodeJS wiki sync tests stay on their existing path.
Expose authenticated GET/PUT endpoints for HTML workspaces so mobile clients can sync single-file wikis without Git.
Avoid Node globals in renderer-loaded workspace settings code and cover HTML workspace rename persistence.
linonetwo and others added 5 commits June 25, 2026 16:41
…larify save paths

- Make restartWiki delegate HTML workspaces to HtmlWikiService instead of the NodeJS wiki worker path.
- Replace the regex-based file chooser Cucumber step with a plain expression.
- Expand JSDoc to explain the relationship between the injected bootstrap saver and the Electron download-boundary fallback.
- Replace regex with two Cucumber Expression step definitions,
  since optional groups cannot contain parameter types per spec.
- Add type assertion for ipaddr.js IPv4/IPv6 union match() call.
Inline read & validation in readHtmlWikiFile and writeHtmlWikiFile
to eliminate the time-of-check-to-time-of-use gap between
validateHtmlWikiFile and subsequent fs.readFile.
@linonetwo
linonetwo merged commit dcc39e4 into master Jun 25, 2026
31 of 32 checks passed
linonetwo added a commit that referenced this pull request Jun 25, 2026
* feat(workspaces): add HTML wiki workspace type and path helpers

Introduce WorkspaceType.html, htmlFileLocation on IWorkspace, and path/git-scope utilities. Sanitize and create flows skip tidgi.config for HTML workspaces.

* feat(workspaces): add folder and HTML wiki strategies

Strategy pattern isolates folder vs single-file HTML startup, HTTP routing, and git scope resolution.

* feat(htmlWiki): wire HTML wiki into IPC routes and workspace lifecycle

Route GET/PUT through workspace strategies, start HTML HTTP server instead of wiki worker, and delegate stopWiki to HtmlWiki.

* feat(git): scope git operations to single HTML file

Add gitScope helpers, scoped commit/log for HTML workspaces, and GitLog filtering by workspace file path.

* feat(ui): add HTML wiki workspace UI and settings

Open HTML file from Add Workspace, filter edit sections by type, show HTML path, optional file deletion, and workspace menu support.

* feat(i18n): add HTML wiki workspace translations

English and Simplified Chinese strings for open HTML file, settings labels, and delete confirmations.

* test(htmlWiki): add unit and E2E coverage for HTML workspaces

Cover path/git scope, registry filtering, scoped git ops, GitLog scope, and Cucumber scenarios for add workspace and git log isolation.

* chore(deps): sync pnpm-lock for registry-js on Windows

* test(e2e): enforce strict cucumber args via run-e2e entry

* fix(workspaces): keep workspacePaths out of preload bundle

* fix(htmlWiki): route HTML workspaces away from node wiki worker

* fix(gitLog): use renderer-safe git scope and dedupe loads for HTML wikis

* refactor(e2e): consolidate cucumber arg validation into run-e2e.ts

* fix(lint): resolve ESLint issues on HTML wiki branch

* feat(htmlWiki): persist saves via bootstrap injection and download intercept

Inject TiddlyFox-style saver bootstrap into served HTML wikis and bridge saves
through IPC instead of triggering browser downloads.

* feat(htmlWiki): hide sub-workspace settings for HTML imports

Force HTML workspaces to standalone mode and hide advanced main/sub options
in the import dialog.

* test(e2e): add HTML wiki import, save, and reopen scenarios

Generate blank HTML via tiddlywiki CLI and exercise real UI save flow with
active workspace view targeting.

* test(e2e): route mobile sync through mock HTTP server

Replace in-step dugite mobile simulation with a separate Node mock server so
sync E2E exercises the same network boundary as a real mobile client.

* test(e2e): restore direct mobile sync steps

Remove the mock mobile Git HTTP server from Desktop E2E so NodeJS wiki sync tests stay on their existing path.

* feat(htmlWiki): add whole-file HTML sync API

Expose authenticated GET/PUT endpoints for HTML workspaces so mobile clients can sync single-file wikis without Git.

* fix(html): keep workspace settings renderer-safe

Avoid Node globals in renderer-loaded workspace settings code and cover HTML workspace rename persistence.

* fix(html): stabilize HTML workspace review fixes

* ci: trigger CI run on latest html workspace fixes

* fix(html): route HTML workspace restart through HtmlWikiService and clarify save paths

- Make restartWiki delegate HTML workspaces to HtmlWikiService instead of the NodeJS wiki worker path.
- Replace the regex-based file chooser Cucumber step with a plain expression.
- Expand JSDoc to explain the relationship between the injected bootstrap saver and the Electron download-boundary fallback.

* fix: resolve Cucumber Expression syntax error and TS union type issue

- Replace regex with two Cucumber Expression step definitions,
  since optional groups cannot contain parameter types per spec.
- Add type assertion for ipaddr.js IPv4/IPv6 union match() call.

* fix(htmlWiki): remove TOCTOU race condition in htmlFileIO

Inline read & validation in readHtmlWikiFile and writeHtmlWikiFile
to eliminate the time-of-check-to-time-of-use gap between
validateHtmlWikiFile and subsequent fs.readFile.

---------
linonetwo added a commit that referenced this pull request Jun 25, 2026
#726 removed IS_TEST_ENV (process.env.NODE_ENV) from SchemaRenderer and
GenericSchemaRenderer to keep them renderer-safe. Restore the test-mode
behavior properly through window.service.context.get('isTest'):

- In test mode, all preference sections are rendered immediately
- In test mode, lazy-loading idle callbacks are skipped
- Falls back to incremental loading in production
linonetwo added a commit that referenced this pull request Jun 25, 2026
* fix: restore missing rememberLastPageVisited switch in workspace config

Closes #728

- Remove early return when rememberLastPageVisited is false, so the section is always visible
- Add Switch component to toggle rememberLastPageVisited preference
- Replace usePromiseValue with usePreferenceObservable for reactive updates
- Only show lastUrl TextField when the toggle is enabled

* fix: handle tidgi deep links from within WebView pages

Three-layer interception for tidgi:// URLs:
- will-navigate handler in setupViewEventHandlers
- window.open() handler in handleNewWindow
- protocol handler fallback in setupIpcServerRoutesHandlers

* fix: improve LastUrlItem UI with toggle switch

Replace always-visible TextField with a Switch to toggle
rememberLastPageVisited preference, showing the TextField only when enabled

* chore: update template/wiki submodule

* fix: guard process.env access in protocol.ts for renderer safety

* revert silly deepseek

* fix: remove process.env from protocol.ts for renderer safety

protocol.ts is imported by both main and renderer processes, but
process.env is not available in the renderer (browser) context.

- protocol.ts now always exports 'tidgi' (renderer-safe)
- main.ts uses isTest from environment.ts for test-mode scheme
- handleNewWindow/setupViewEventHandlers check both prefix variants
- deepLink/index.ts computes test-aware scheme locally

* fix: compute protocol scheme via isTest instead of hardcoding

Use isTest from environment.ts in main process files to derive the
correct scheme (tidgi-test in test mode, tidgi otherwise).

Remove protocol.ts import from renderer files (Search.tsx, EmbeddingItem.tsx)
- the renderer always uses the production scheme 'tidgi', and should not
  depend on process.env-sensitive constants.

* fix: add getProtocolScheme to deepLink service for renderer use

Renderer processes now obtain the protocol scheme via IPC
(window.service.deepLink.getProtocolScheme()) instead of importing
protocol.ts directly or hardcoding 'tidgi'.

The main process DeepLinkService uses isTest from environment.ts to
return the correct scheme (tidgi or tidgi-test).

* fix: restore process.env in protocol.ts, use TIDGI_PROTOCOL_SCHEME everywhere

protocol.ts now properly computes tidgi/tidgi-test via process.env.
All main process files use the canonical TIDGI_PROTOCOL_SCHEME constant.
Renderer files get the scheme via window.service.deepLink.getProtocolScheme().

* fix: use context.get('isTest') instead of dedicated getProtocolScheme

Renderer obtains test-mode status via window.service.context.get('isTest'),
the canonical way to forward environment variables from main to renderer.
Removes the unnecessary getProtocolScheme from DeepLinkService.

* fix: restore test-mode section rendering via context service

#726 removed IS_TEST_ENV (process.env.NODE_ENV) from SchemaRenderer and
GenericSchemaRenderer to keep them renderer-safe. Restore the test-mode
behavior properly through window.service.context.get('isTest'):

- In test mode, all preference sections are rendered immediately
- In test mode, lazy-loading idle callbacks are skipped
- Falls back to incremental loading in production

* chore: update template/wiki submodule

* feat: support tidgi://workspaceId/preferences/section deep links

New URL format: tidgi://<workspaceId>/preferences/<sectionId>
opens the edit workspace window for the given workspace.

- deepLink handler parses /preferences/ pathname for workspace-scoped links
- protocol handler catches /preferences/ pathname in addition to hostname
- EmbeddingItem now includes workspaceId in the deep link URL

* fix: keep externalAPI as global preferences deep link

externalAPI is a global PreferenceSection, not workspace-specific.
Use tidgi://preferences/externalAPI (without workspaceId) for it.

* feat: support tidgi://workspace/preferences/<section> deep links

- tidgi://workspace/preferences/<section> opens settings for the active workspace.
- tidgi://<workspaceId>/preferences/<section> also works.
- EditWorkspace window now accepts preferenceGotoTab metadata and scrolls to the requested section.
- Adds unit tests for the workspace-scoped preferences deep link.

* Update wiki
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.

3 participants