Repository navigation
Add VSCode Extension for Object UI - #72
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ext detection Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot stopped work on behalf of
hotlong due to an error
January 15, 2026 07:21
Contributor
|
@copilot 继续 |
Collaborator
|
@copilot review again |
Copilot stopped work on behalf of
hotlong due to an error
January 15, 2026 07:57
Contributor
Author
The VSCode extension is complete and ready for review. Here's what has been implemented: ✅ Features Complete:
✅ Quality Checks:
📦 Package Structure: The extension is production-ready and can be published to the VSCode Marketplace following the instructions in |
Copilot
AI
changed the title
[WIP] Design VSCode plugin
Add VSCode Extension for Object UI
Jan 15, 2026
huangyiirene
approved these changes
Jan 15, 2026
huangyiirene
marked this pull request as ready for review
January 15, 2026 08:03
| language: 'json', | ||
| }); | ||
|
|
||
| const editor = await vscode.window.showTextDocument(doc); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Contributor
📦 Bundle Size Report
Size Limits
|
Contributor
|
✅ All checks passed!
|
Copilot AI
added a commit
that referenced
this pull request
Feb 16, 2026
- Export TimelineConfig and TimelineConfigSchema from @object-ui/types (#64) - Export NavigationConfig and NavigationConfigSchema from @object-ui/types - Update ObjectTimeline to use spec-compliant startDateField with backward compat (#72) - Add endDateField, groupByField, colorField, scale to ObjectTimeline - Add navigation support to ObjectGallery via useNavigationOverlay (#66) - Implement navigation.view property in useNavigationOverlay hook (#68) - Implement emptyState spec property in ListView (#71) - Add emptyState to ListViewSchema type - Add tests for all new functionality Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
This was referenced Sep 7, 2026
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 28, 2026
…ields re-export it (objectui#8261) (objectstack-ai#10703) Fixes objectstack-ai#8261 Clause-②: yes — `@object-ui/i18n` publishes a new name, `TranslateFn` Executes the maintainer's ruling on objectui#8165 (comment 5565867673, decision batch objectstack-ai#72, option A): the narrowed i18next `t` gets ONE authority, exported from `@object-ui/i18n`, and the two remaining declarations become type re-exports of it. Round 1 was verified at `367e586e4`. Round 2 (`b235ae53d`) applies the contract review's prose ruling and re-points the last local copy; its checks are listed separately below. Spelling note: GitHub strips tag-shaped fragments from bodies, so the options parameter's type is written `Record(string, unknown)` here; the source spells it with angle brackets. ## What changed - `packages/i18n/src/translateFn.ts` (new): `export type TranslateFn = (key: string, options?: Record(string, unknown)) => string;` with a docblock naming it the one authority. - `packages/i18n/src/index.ts`: `export type { TranslateFn } from './translateFn.js';`, next to the existing `SafeTranslate` export. - `packages/app-shell/src/providers/writeWarningToast.ts` and `packages/fields/src/widgets/file-size-guard.ts`: the local declaration is gone. Each now does `import type { TranslateFn } from '@object-ui/i18n'` for its own uses and `export type { TranslateFn } from '@object-ui/i18n'`, so every existing import of the name from these two modules still resolves. From `writeWarningToast` that is `AdapterProvider`; from `file-size-guard` it is `FileField`, `ImageField`, `LocationField` and `numberBadInput`. None of their import paths change. - `packages/app-shell/src/providers/saveAdvisoryToast.ts` and `metadataReadWarningToast.ts` now re-export from `@object-ui/i18n` directly, not through `writeWarningToast`. Their docblocks said `writeWarningToast` was the owner, which this change makes false, so they had to be rewritten anyway. Pointing them at the real owner means an import resolves in one hop and no module in the chain claims ownership it lacks. - `packages/app-shell/src/preview/usePublishAllDrafts.ts` and `packages/app-shell/src/utils/managedByEmptyState.ts`: each local, unexported `type TranslateFn` is replaced by `import type { TranslateFn } from '@object-ui/i18n'` (see H1). `managedByEmptyState.ts` was added in round 2, when the seat widened the file surface by this one file. - `scripts/__tests__/one-authority-per-exported-name-6273.test.ts`: the `TranslateFn` row is removed from `KNOWN_COLLISIONS`. Its comment block is replaced by a "sat here" note in the form the other retired rows use. No line was added. - `.changeset/8261-translatefn-i18n-authority.md`: `'@object-ui/i18n': minor` (a newly published name), `'@object-ui/app-shell': patch`, `'@object-ui/fields': patch`. No `major`. - `.changeset/8165-translatefn-one-authority.md`: prose reconciled with a dated note (H6). The frontmatter is byte-identical. - `packages/i18n/README.md`: a short `TranslateFn` subsection (H6). After this change, `git grep` over `packages/*/src` finds exactly **1** declaration of `TranslateFn` (exported or local, `type` or `interface`): `packages/i18n/src/translateFn.ts`. The same pattern finds 4 on the base `c659439b4`, which is the control. ## H1: census on the base (`c659439b4`) `TranslateFn` declarations: | site | exported? | seen by the one-authority gate? | | :-- | :-- | :-- | | `packages/app-shell/src/providers/writeWarningToast.ts` | yes | yes (the gate's row) | | `packages/fields/src/widgets/file-size-guard.ts` | yes | yes (the gate's row) | | `packages/app-shell/src/preview/usePublishAllDrafts.ts` | no | no | | `packages/app-shell/src/utils/managedByEmptyState.ts` | no | no | `saveAdvisoryToast.ts` and `metadataReadWarningToast.ts` re-exported the name from `writeWarningToast`, as the order stated. Neither local declaration is visible to the gate. Its `DECLARATION` pattern needs a leading `export`, and it counts exported type-level names only (bound 1 in its header). Both local declarations are rows in objectui#8203's table. - **`usePublishAllDrafts.ts` is re-pointed.** It is in this order's file surface. The order also asked whether it is identical in shape. It is identical in type, but not byte-identical: the parameter is spelled `opts`. TypeScript does not compare parameter names when it checks a function type, so the signature of `usePublishAllDrafts(t: TranslateFn)` is unchanged. `packages/i18n/src/__tests__/perm-home-namespace-3546.test.tsx` pins the text `export function usePublishAllDrafts(t: TranslateFn)`, which is kept. - **`managedByEmptyState.ts` is re-pointed (round 2).** Round 1 left it alone because it was outside the file surface. The contract review then found that it made two published sentences false, and the seat widened the surface by this file. Before re-pointing, its declaration was checked against the authority with the `export` prefix set aside. Both are `type TranslateFn = (key: string, options?: Record(string, unknown)) => string;`, 79 bytes with the newline, sha256 `083c3a40d29b6f256a603bb907f3e4de032a4dfe5abcca6c199220172d9dea24`. It is byte-identical, so no signature moves. The same shape under other names on the base: `TranslationFn` (AiChatPage), `TFn` (CloudAiModelStatus), `OrgTranslate` (exported), `Translate` (`packages/core/src/actions/recordDelete.ts`), `InboxTranslate` (exported), `ActivityTranslate`, `CommentsTranslate`, `SummaryTranslate` and `TimelineTranslate` (exported). Some spell the second parameter `vars` or `params`. These are objectui#8203's population. objectui#8203 is closed `not_planned` and is not addressed here. ## H2: byte-identity, re-measured before re-pointing On `c659439b4`, the two exported declarations are the same line: ``` export type TranslateFn = (key: string, options?: Record(string, unknown)) => string; sha256 29f2f334f47b8ac55bd05fc5dcf7f0d769c303f0e2deb1c79aff6a9cd46e3762 (both lines, trailing newline included: 86 bytes) sha256 1a7e8e9dd0c69e6cfb4e6ccff472df17d878277ef4eafb907fbb018d6600e2b2 (both, without the newline: 85 bytes) cmp exit 0; identical od -c dumps ``` This matches the card's `29f2f334…`, 86 bytes on `158d75bb3`, so nothing has drifted. The new declaration in `@object-ui/i18n` is the same line, so re-pointing changes no call site's contract. ## H3: the home - `@object-ui/i18n`'s `package.json` declares `types` and `exports['.'].types` as `./dist/index.d.ts`. `tsconfig.json` sets `rootDir: src`, so the entry file is `packages/i18n/src/index.ts`. The package has no stale second entry. - `@object-ui/app-shell` and `@object-ui/fields` both already list `@object-ui/i18n: workspace:*` in `dependencies`. `@object-ui/i18n`'s only workspace dependency is `@object-ui/core`, which depends only on `@object-ui/types`, so there is no cycle. **No `package.json` changed.** - Built declaration, after `turbo run build --filter='@object-ui/app-shell^...'` (28/28 successful): | file | `TranslateFn` | control | | :-- | --: | :-- | | `packages/i18n/dist/index.d.ts` | 1: `export type { TranslateFn } from './translateFn.js';` | `SafeTranslate` 2 | | `packages/i18n/dist/translateFn.d.ts` | 3 (the declaration plus two docblock mentions) | n/a | | `packages/fields/dist/index.d.ts` | **0**: the name is not on `@object-ui/fields`' face | `FileField` 2 | ## H5: the gate, before and after, plus ablation | run | tree | result | | :-- | :-- | :-- | | gate BEFORE | detached worktree at `c659439b4` (`TranslateFn` rows: 1) | Test Files 1 passed (1), Tests 11 passed (11) | | gate AFTER | head `367e586e4` (`TranslateFn` rows: 0) | Test Files 1 passed (1), Tests 11 passed (11) | Ablation was run at `367e586e4` after the commit. Every leg went through `scripts/ablation-replace.mjs` (objectstack) in wrap mode: the anchor had to hit exactly once, the blob change was checked on disk, and the file was restored from `HEAD`. The gate reads source from disk, so no build or `dist` is involved in legs A and B. - **Leg A: a local declaration put back in `file-size-guard.ts`.** The re-export line was replaced by the old declaration: anchor x1 to x0, replacement x0 to x1, blob `ca873659cf07` to `6e625184bee3`. Gate exit 1 (Tests 1 failed, 10 passed). The collision is named: ``` TranslateFn — a NEW colliding name packages/fields/src/widgets/file-size-guard.ts — type declaration packages/i18n/src/translateFn.ts — type declaration ⛔ KNOWN_COLLISIONS is SHRINK-ONLY: adding a line is not a supported way … ``` - **Leg B: the removed row put back, re-points kept.** This is the stale-row direction, modelled on objectstack-ai#8205's leg B. The mutation was 0 rows to 1, blob `600bed9be040` to `38991d28dc31`. Gate exit 1 (Tests 1 failed, 10 passed), which proves the row removal was owed: ``` KNOWN_COLLISIONS lists collisions that no longer exist … TranslateFn — no longer collides at: packages/app-shell/src/providers/writeWarningToast.ts packages/fields/src/widgets/file-size-guard.ts ``` - **Leg C: type reverse-verification of the rebuilt `.d.ts`.** A probe `export const typeProbe8261: TranslateFn = (key: number) => String(key);` was planted in `file-size-guard.ts`, then `pnpm --filter @object-ui/fields exec tsc --noEmit` was run. Exit 1 with exactly one error, `error TS2322: Type '(key: number) => string' is not assignable to type 'TranslateFn'.` This shows that the type `fields` resolves from `@object-ui/i18n` is the real narrowed shape, not an `any` from an unresolved or stale declaration. - **Restore, proven by state.** Both paths ended with disk blob equal to the `HEAD` blob: `ca873659cf07…` for `file-size-guard.ts` and `600bed9be040…` for the gate. `git diff HEAD` was empty. After the run: declarations 0, re-export 1, rows 0. ## H6: published prose - **`packages/i18n/README.md`** did not list the package's exported types; its API section documents functions. Per AGENTS.md commandment objectstack-ai#2, it gains a short `### TranslateFn — typing a t you are handed` subsection with one `ts` snippet. - The section says the package is "the one authority for that type". It deliberately does not say "the one place that type is declared", because the same shape still exists under other names, such as core's `Translate`. - `check:readme-exports` judges `TranslateFn` as `real` from `@object-ui/i18n`. - The snippet was also compiled standalone with `tsc --strict` against the built `packages/i18n/dist/index.d.ts`: exit 0. A negative control changing `t('common.save')` to `t(42)` gave exit 2 with TS2345. - **Pending changesets.** `git grep -l TranslateFn c659439 -- .changeset` finds one file, `.changeset/8165-translatefn-one-authority.md`. This change makes two of its sentences false: that `writeWarningToast` is the one authority, and that the name is on no package's published face. Following the objectui#10533 form: - both sentences are now scoped "at this change"; - a `⚠️ **Dated note, 2026-09-25 — the one authority has since moved to @object-ui/i18n — objectui#8261.**` paragraph follows them; - the frontmatter is unchanged: lines 1–2 have md5 `2ee28f1e1b449ccc2dd97fdcc6c2bc1f` before and after. - **This change's own changeset** says "`writeWarningToast`, which its sibling toast modules re-export", because on the base, among app-shell's toast modules, only `writeWarningToast` declared the name; `saveAdvisoryToast` and `metadataReadWarningToast` re-exported it from there. It also keeps "the name now has one declaration", which the count above re-derives. Its frontmatter (lines 1–5) has md5 `014eca5f59a0b36c1901fefa5467f47c` at both `367e586e4` and `b235ae53d`. - `check:changeset-claims` lists three other pending bodies that name a file this change touches: `6349-types-internal-name-collisions-batch-1`, `8632-malformed-picklist-option-loud` and `9615-locale-count-ten`. I read all three and none is falsified. Each describes its own change, and the README heading `8632` cites still exists. ## Round 2 checks (at `b235ae53d`) | run | result | | :-- | :-- | | `turbo run build --filter='@object-ui/app-shell^...' --concurrency=2` | 28 successful, 28 total | | `pnpm --filter @object-ui/fields type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`) | exit 0, zero `error TS` | | `pnpm --filter @object-ui/app-shell type-check` (same pair) | exit 0, zero `error TS` | | `vitest run` over the one-authority gate and `packages/app-shell/src/utils/` | the gate file has 11 of 11 tests passed, including `declares no name twice outside the named, shrinking baseline`. The whole run shows Test Files 35 passed, 1 skipped (36) and Tests 559 passed, 8 skipped (567); the lock run printed `VERDICT command-exit 0`. The skipped file is `auditHistoryDisplay.dateOnlyZone-10183.test.ts`, which is timezone-conditional and unrelated to this change | | `node scripts/check-control-bytes.mjs` | OK (8784 tracked text files) | | `pnpm check:new-line-citations` | `VERDICT new-cross-file-line-citations: 0 new citation(s)` | | `node scripts/check-changeset-presence.mjs` | exit 0: 8 source files of 3 released packages changed, 1 changeset added | | `git merge-tree --write-tree HEAD 56b7fb4` (fresh `main`) | clean. None of main's 151 moved paths is among this branch's 12, and main's diff has 0 `TranslateFn` lines, so no merge was made | ## Round 1 tests and gates (all at `367e586e4`) Heavy runs went through `os-verify-lock.sh`, and the verdicts are its own `VERDICT` lines. Timings are shared-box seconds. | run | result | | :-- | :-- | | `turbo run build --filter='@object-ui/app-shell^...' --concurrency=2` | 28 successful, 28 total; `VERDICT command-exit 0` | | `pnpm --filter @object-ui/i18n type-check` | exit 0, zero `error TS` | | `pnpm --filter @object-ui/fields type-check` | exit 0, zero `error TS` | | `pnpm --filter @object-ui/app-shell type-check` | exit 0, zero `error TS` | | `pnpm type-check:scripts` (covers the gate file) | exit 0, zero `error TS` | | `pnpm exec vitest run` over the gate, `packages/i18n/`, app-shell `providers/`, `preview/`, `console/home/__tests__/`, `MetadataService.saveAdvisories`, `useMetadataClient.advisorySink`, and the 28 fields test files naming a `file-size-guard` consumer | **Test Files 149 passed (149), Tests 2616 passed (2616)**; `VERDICT command-exit 0` | | `node scripts/check-changeset-presence.mjs` | exit 0: 7 source files of 3 released packages changed, 1 changeset added | | `check-changeset-no-major` / `check-changeset-fixed` | exit 0 / exit 0 | | `check-changeset-overwrite` | exit 0. Report-only; it reports the `8165` edit as its case 2 ("correcting … on purpose"), and both sides declare nothing | | `pnpm check:new-line-citations` | `VERDICT new-cross-file-line-citations: 0 new citation(s)` | | `pnpm check:control-bytes` | OK (8784 tracked text files) | | `check:doc-fences` / `docs:check-links` / `check:readme-exports` | exit 0 / exit 0 / exit 0 | | `check:phantom-deps` / `check:unused-deps` / `check:unreferenced-sources` | exit 0 / exit 0 / exit 0 | | `check:pending-changeset-literals` / `check:i18n-keys` / `check:esm-specifiers` | exit 0 / exit 0 / exit 0 | | `check-governed-queue-guard --test` on the 11 changed paths | NOT GOVERNED | | `eslint --no-inline-config --format json` on the 8 changed source files | 8 files, 0 errors, 3 warnings. All 3 are pre-existing `no-explicit-any` in `usePublishAllDrafts.ts`; the base file has the same 3 | **Declared narrowings**, so what was left out is visible: - **Tests are targeted, not whole packages.** The change is type-only (`import type` / `export type` erase at build). The full app-shell and fields suites are CI's. - **Lint ran on the 8 changed files, not the repository.** The file count comes from eslint's own JSON. `eslint.config.js` has no type-aware linting: no `projectService`, no `parserOptions.project`, and a control grep for `typescript-eslint` in the same file fires. So this diff cannot move the verdict on any untouched file. Repo-wide `pnpm lint` is CI's. - **`check:doc-snippets` was NOT MEASURED locally.** It needs almost the whole workspace built. The README snippet was instead compiled standalone against the built `.d.ts`, with a negative control, as shown under H6. - **`check:readme-exports` saw 8 packages unbuilt.** Their rows are unjudged locally. The `@object-ui/i18n` rows, including `TranslateFn`, were judged. - **Main at round 1 was `69a6fc1ce`.** The merge-tree was clean with zero overlapping paths. Round 2's fresh-main reading is in the table above. ## Acceptance notes - **For whoever takes up objectui#8203's population:** `packages/core/src/actions/recordDelete.ts` `Translate` can never point at `@object-ui/i18n`, because `@object-ui/i18n` depends on `@object-ui/core`. - **Labels:** the card says the landing PR carries `needs:contract-review`. This dispatch allowed no label write beyond the PR assignee, so the seat applied it; the seat removes it at landing, after a contract review PASS. - objectui#8165: its `fields` half is done by construction here. The ruling comment says that card closes on the gate's reading of the `KNOWN_COLLISIONS` entry, so objectui#8165 remains open for the seat to close. ⛔ Left as **draft** on purpose: the seat flips it after review. --- _Generated by [Claude Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
VSCode Extension Design for Object UI
Complete implementation of a production-ready VSCode extension for Object UI that provides a comprehensive development experience for schema-driven UI development.
Features Implemented
Core Functionality
Developer Tools
.objectui.json,.oui.json, andapp.jsonfilesImplementation Details
src/extension.ts- Activation and command registrationCompletionProvider.ts- Context-aware IntelliSenseHoverProvider.ts- Documentation on hover with Markdown formattingSchemaValidator.ts- Real-time schema validation with diagnosticsPreviewProvider.ts- Webview-based live previewDocumentation
Quality Assurance
Project Updates
The extension is production-ready and can be published to the VSCode Marketplace immediately.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.