Skip to content

Commit fef5795

Browse files
committed
refactor(ui)!: retire test-only barrel helpers, CommentSearchResult and four dead publicForm keys
- core: resetActionKeyWarnings leaves the package entry (actions barrel re-exports actionKeys by name) - react: __resetVisibilityPredicateWarnings leaves the package entry; nine cross-package tests import it from its declaring module - plugin-detail: resetUnknownActivityTypeWarnings leaves the package entry; its one cross-package test imports the declaring module - types: CommentSearchResult is deleted; its record-id pin drops the row - i18n: publicForm.consentRequired/rateLimited/redirectBlocked/requiredHint leave all ten packs Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKqWksC1TiqsHCrrU
1 parent eeec88d commit fef5795

31 files changed

Lines changed: 104 additions & 90 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
refactor(core)!: take the test-only `resetActionKeyWarnings` off the package entry
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/core#resetActionKeyWarnings) the retired operand is a test seam that clears a warn-once memo; nothing in the workspace or in hotcrm imported it from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names it, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports `resetActionKeyWarnings` from `@object-ui/core`. It cleared the once-per-key memo behind the unknown-action-key warning and existed for tests; core's own tests reach it through the module that declares it. The other ten names of that module (`ACTION_DEF_KEYS`, `SPEC_ACTION_KEYS`, `NAVIGATION_ALIAS_KEYS`, `HOST_DISPATCH_ACTION_KEYS`, `RETIRED_ACTION_KEYS`, `KNOWN_ACTION_KEYS`, `classifyActionKeys`, `warnOnUnknownActionKeys`, `hasDeprecatedObjectParams`, `warnOnDeprecatedObjectParams`) stay exported unchanged, and the warning itself still fires once per key.
13+
14+
- FROM `resetActionKeyWarnings()` in a test TO a fresh module instance per test (`vi.resetModules()` before importing `@object-ui/core`), or no reset at all when the test asserts the first warning only.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/i18n': patch
3+
---
4+
5+
refactor(i18n)!: delete four `publicForm` keys that no screen reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) the four deleted keys are message strings in the built-in locale packs that no t() call site in the workspace or in hotcrm reads; they are not metadata, no packages/spec schema or stored shape names them, and a host that kept its own text under these keys keeps it in its own resources -->
11+
12+
**BREAKING** only for TypeScript code that names one of the deleted keys through the pack-derived key type (`TranslationKeys`): `publicForm.consentRequired`, `publicForm.rateLimited`, `publicForm.redirectBlocked` and `publicForm.requiredHint` leave all ten packs (ar, de, en, es, fr, ja, ko, pt, ru, zh). No screen in the Console or in any `@object-ui/*` package showed them. The form page's other `publicForm` keys (`submit`, `submitting`, `poweredBy`, `thankYouTitle`, `thankYouMessage`, `redirecting`, `redirectPending`, `loading`, `requiredFields`) are unchanged.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/plugin-detail': patch
3+
---
4+
5+
refactor(plugin-detail)!: take the test-only `resetUnknownActivityTypeWarnings` off the package entry
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-detail#resetUnknownActivityTypeWarnings) the retired operand is a test seam that clears the warn-once bucket of the unmapped activity-type diagnostic; no shipped code in the workspace or in hotcrm called it, and no packages/spec schema, registered node type, conversion surface or stored shape names it, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports `resetUnknownActivityTypeWarnings` from `@object-ui/plugin-detail`. It existed for tests; the one workspace test outside the package now imports it from the module that declares it. `ACTIVITY_TYPE_TO_FEED_TYPE`, `UNMAPPED_ACTIVITY_FEED_TYPE`, `activityRowToFeedItem` and `isRefusedFeedRead` stay exported unchanged, and the diagnostic still warns once per unmapped type.
13+
14+
- FROM `resetUnknownActivityTypeWarnings()` in a test TO a fresh module instance per test (`vi.resetModules()` before importing `@object-ui/plugin-detail`), or an activity type unique to that test.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/react': patch
3+
---
4+
5+
refactor(react)!: take the test-only `__resetVisibilityPredicateWarnings` off the package entry
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/react#__resetVisibilityPredicateWarnings) the retired operand is a test seam that clears the once-per-predicate dedupe of the unresolvable-visibility report; no shipped code in the workspace or in hotcrm called it, and no packages/spec schema, registered node type, conversion surface or stored shape names it, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports `__resetVisibilityPredicateWarnings` from `@object-ui/react`. The double-underscore name already marked it as a test seam; the workspace tests that used it now import it from the module that declares it. `reportUnresolvableVisibilityPredicate`, `formatUnresolvableVisibilityMessage`, `UNRESOLVABLE_VISIBILITY_PREFIX`, `UNRESOLVABLE_ENABLEMENT_PREFIX` and the `PredicateScopeTier` type stay exported unchanged, and the report still dedupes per predicate.
13+
14+
- FROM `__resetVisibilityPredicateWarnings()` in a test TO a fresh module instance per test (`vi.resetModules()` before importing `@object-ui/react`), or a predicate source string unique to that test so the dedupe cannot hide its line.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
refactor(types)!: retire the zero-consumer `CommentSearchResult` interface
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/types#CommentSearchResult) the retired operand is a TypeScript interface for a cross-record comment search result; its only producer, the `useCommentSearch` hook of `@object-ui/collaboration`, already retired, and nothing in the workspace or in hotcrm reads the type; no packages/spec schema, registered node type, conversion surface or stored shape names it, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports the type `CommentSearchResult` from `@object-ui/types`. It described the hits of a comment search the packages no longer ship. `CommentEntry`, `MentionNotification` and `ActivityEntry` stay exported unchanged.
13+
14+
- FROM `CommentSearchResult` TO a local interface in your own code: `{ comment: CommentEntry; objectName: string; recordId: string; highlight?: string }`.

‎ui/apps/console/src/__tests__/App.homePermissions-12700.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import { describe, it, expect, vi, beforeEach, afterEach, type MockInstance } fr
3434
import { render, screen, cleanup, waitFor, act } from '@testing-library/react';
3535
import { useContext, type ReactNode } from 'react';
3636
import { useNavigate } from 'react-router-dom';
37-
import { MetadataCtx, type MetadataContextValue, __resetVisibilityPredicateWarnings } from '@object-ui/react';
37+
import { MetadataCtx, type MetadataContextValue } from '@object-ui/react';
38+
import { __resetVisibilityPredicateWarnings } from '../../../../packages/react/src/utils/visibilityDiagnostic';
3839
import { usePermissions, type MePermissionsResponse } from '@object-ui/permissions';
3940
// Not on the package's entry: the context object itself, read by its module id
4041
// (`@object-ui/permissions` resolves to `packages/permissions/src`, so this is

‎ui/packages/app-shell/src/layout/__tests__/UnifiedSidebar.navCanPermissions-12700.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { render, screen, waitFor, act } from '@testing-library/react';
2626
import { MemoryRouter } from 'react-router-dom';
2727
import type { NavigationItem } from '@object-ui/types';
2828
import { MePermissionsProvider, type MePermissionsResponse } from '@object-ui/permissions';
29-
import { __resetVisibilityPredicateWarnings } from '@object-ui/react';
29+
import { __resetVisibilityPredicateWarnings } from '../../../../react/src/utils/visibilityDiagnostic';
3030

3131
vi.mock('@object-ui/i18n', async (importOriginal) => ({
3232
...(await importOriginal<Record<string, unknown>>()),

‎ui/packages/app-shell/src/providers/ExpressionProvider.visibleFaultDiagnostic.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
6969
import { ExpressionEvaluator } from '@object-ui/core';
7070
import {
7171
UNRESOLVABLE_VISIBILITY_PREFIX,
72-
__resetVisibilityPredicateWarnings,
7372
} from '@object-ui/react';
73+
import { __resetVisibilityPredicateWarnings } from '../../../react/src/utils/visibilityDiagnostic';
7474
import { hasVisibleNavigationItems } from '@object-ui/layout';
7575
import { buildExpressionScope, evaluateVisibility } from './ExpressionProvider';
7676

‎ui/packages/app-shell/src/providers/__tests__/navigationVisibility-12700.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import { describe, it, expect, vi, beforeEach, afterEach, type MockInstance } from 'vitest';
1919
import { toEvalPermissions } from '@objectstack/formula';
20-
import { __resetVisibilityPredicateWarnings } from '@object-ui/react';
20+
import { __resetVisibilityPredicateWarnings } from '../../../../react/src/utils/visibilityDiagnostic';
2121
import {
2222
createExpressionEvaluator,
2323
evaluateNavigationVisibility,

‎ui/packages/app-shell/src/providers/__tests__/navigationVisibility.bareCel-27457.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
import { describe, it, expect, vi, beforeEach, afterEach, type MockInstance } from 'vitest';
26-
import { __resetVisibilityPredicateWarnings } from '@object-ui/react';
26+
import { __resetVisibilityPredicateWarnings } from '../../../../react/src/utils/visibilityDiagnostic';
2727
import {
2828
createExpressionEvaluator,
2929
evaluateNavigationVisibility,

0 commit comments

Comments
 (0)