Skip to content

Fix/mcp#723

Merged
linonetwo merged 21 commits into
masterfrom
fix/mcp
Jun 12, 2026
Merged

Fix/mcp#723
linonetwo merged 21 commits into
masterfrom
fix/mcp

Conversation

@linonetwo

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 10, 2026 18:24

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

This PR refactors several Preferences sections to be schema-driven via item-level custom components, adds a conditional hidden system for preference definitions (used to hide MCP token-related settings), and expands the MCP server/tooling (new ui_window tool plus snapshot truncation/drill-down support).

Changes:

  • Schema-ify Preferences sections by replacing large custom section components (Sync / TidGiMiniWindow / DeveloperTools) with smaller custom items registered via componentId.
  • Introduce hidden conditions for preference section/item definitions and apply them to rendering + search (e.g., hide MCP token items when token auth is disabled).
  • Enhance MCP server/tooling (ESM import fixes, ui_window, snapshot size summarization + slicing) and adjust MCP auth startup behavior.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test-output-clean.txt Removes committed test output artifact.
src/windows/Preferences/sections/TidGiMiniWindow.tsx Deletes legacy custom section component (migrated to schema + custom items).
src/windows/Preferences/sections/Sync.tsx Deletes legacy custom section component (migrated to schema + custom items).
src/windows/Preferences/sections/tests/TidGiMiniWindow.test.tsx Removes tests for the deleted section component.
src/windows/Preferences/SchemaRenderer.tsx Adds hidden evaluation to item/section rendering and search; defers section skeletons respecting hidden.
src/windows/Preferences/registerCustomSections.tsx Switches from section-level lazy components to item-level custom component registration for developers/sync/miniwindow.
src/windows/Preferences/index.tsx Uses evaluateHidden to control sidebar section visibility based on preference/platform.
src/windows/Preferences/customItems/TidGiMiniWindowItems.tsx Adds new custom items implementing TidGi mini-window settings UI.
src/windows/Preferences/customItems/SyncItems.tsx Adds new custom items for Sync UI (token form, interval picker, AI timeout, “more settings”).
src/windows/Preferences/customItems/DeveloperToolsItems.tsx Splits DeveloperTools into reusable custom items + adds MCP URL copy item.
src/windows/Preferences/customItems/tests/TidGiMiniWindowItems.test.tsx Adds tests for the new mini-window custom items.
src/windows/Preferences/customItems/tests/SyncItems.test.tsx Adds tests for the new sync custom items.
src/windows/Preferences/customItems/tests/DeveloperToolsItems.test.tsx Adds tests for the new developer tools custom items and MCP URL builder.
src/windows/Preferences/tests/AllSectionsRendering.test.tsx Adds coverage for hidden MCP token-related items in render + search.
src/services/preferences/definitions/types.ts Extends schema/types to support hidden as a condition (not just boolean).
src/services/preferences/definitions/tidgiMiniWindow.ts Converts mini-window section to custom items.
src/services/preferences/definitions/sync.ts Converts interval and AI timeout rows to custom items.
src/services/preferences/definitions/developers.ts Uses hidden conditions for MCP token items; swaps actions for custom developer items.
src/services/preferences/definitions/conditions.ts Introduces condition language + evaluateHidden.
src/services/preferences/definitions/tests/conditions.test.ts Adds unit tests for the new condition evaluator.
src/services/native/index.ts Initializes hostname to avoid uninitialized usage.
src/services/mcpServer/types.ts Updates tool inputSchema typing to match MCP SDK zod-compat types.
src/services/mcpServer/tools.ts Adds ui_window tool; improves snapshot tool with max-size summarization + slicing; adds preferences window target.
src/services/mcpServer/sdkAdapter.ts Switches MCP SDK imports to .js ESM paths and passes schema through directly.
src/services/mcpServer/index.ts Changes startup auth handling (can start without token auth if token is empty) + adds test reset helper.
src/services/mcpServer/tests/tools.test.ts Adds tests for ui_window and snapshot summarization/slicing behavior.
src/services/mcpServer/tests/index.test.ts Adds tests for MCP server auth fallback behavior.
localization/locales/zh-Hans/translation.json Adds localized strings for “Copy MCP Server URL” and related descriptions.
localization/locales/en/translation.json Adds localized strings for “Copy MCP Server URL” and related descriptions.

Comment thread src/windows/Preferences/SchemaRenderer.tsx Outdated
Comment thread src/services/mcpServer/tools.ts
Comment thread src/services/mcpServer/index.ts
linonetwo added 12 commits June 11, 2026 02:39
Remove pnpm remove registry-js steps that hang after completion on macOS CI.
Install-time .pnpmfile hook now drops registry-js from dependencies on non-win32.
Clear server handle on EADDRINUSE so restarts can retry, validate port range
before listen, block ui_navigate on app window targets, and remove deprecated
--mcp-port/MCP_PORT CLI bypass plus start:dev:mcp script.
…ation

Move custom-item preference keys into customPreferenceFields.ts, validate
mcpServerPort as a TCP port, hide mini window advanced settings when disabled,
and assert zodPreferencesSchema covers all IPreferences keys.
Non-Windows installs skip registry-js via pnpmfile, which broke eslint on
win32.ts. Add ambient module declarations and fix import ordering.
Run validate:push (tsc + eslint) before git push via husky; commits are
unaffected. Fix MCP index test mock typing so tsc passes in the hook.
Windows runners fail pnpm install when lockfile git resolutions use
git@github.com (e.g. @electron/node-gyp) without SSH keys.
Unquoted git@github.com: trailing colon broke workflow parsing, so Release
App never started and most checks were skipped.
Move workspace sections onto GenericSchemaRenderer, extract shared setting search hits for both settings pages, and replace monolithic custom sections with schema items plus shared custom components.
Use lodash kebabCase for switch test ids, set enable-http-api-switch explicitly, and keep section navigation test ids on the sidebar only.
Use the MUI Select helper for preset selection instead of batch-clicking the dropdown, which is flaky on Windows runners.
…bility.

Calibration is now pnpm run test:e2e:calibrate (CI runs it before shards); missing .calibration.json fails with explicit guidance. Group headers no longer participate in workspace reorder, drag intent zones use live DOM rects, and E2E cleanup only kills the test app PID tree.
Linux calibration was missing a display and each shard re-ran it for 45 minutes. Add a dedicated e2e-calibrate job, upload .calibration.json, and calibrate lazy-all restart on Windows.
upload-artifact v4+ skips dotfiles by default; enable include-hidden-files and fail if missing.
@linonetwo linonetwo merged commit 14855a2 into master Jun 12, 2026
31 of 32 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.

2 participants