Conversation
Contributor
There was a problem hiding this comment.
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
hiddenconditions 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. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.