feat(ui): port memory feature from OD PR #5228, fix fetchMemoryList() bug - #14
Merged
Conversation
Ports the ports/dependencies/rules/formatters/constants/types plus all 6 feature-local hooks from the pinned, never-merged OD PR #5228 (nexu-io/open-design, commit d695f1e0f2b85a032aa7ce4895a3eb764cb1b65d). Applies the still-open fetchMemoryList() malformed-response fix, and reuses @jini/ui's already-shipped features/connectors reconciliation reducers instead of re-deriving Memory-local duplicates. Components + tests + source-map provenance note land in follow-up commits.
Ports the 8 dumb components (MemoryHooksPanel folded in from OD's components/MemoryHooksPanel.tsx, single consumer) and wires every user-facing string through useT() per the i18n policy. Applies the fetchMemoryList() fix: dependencies.ts now validates entries/rootDir/index/enabled are present on a 2xx response (the four per-hook flags keep their existing legacy-default fallback, matching the code's own established intent). Typecheck and a purity grep both pass clean.
Covers the fetchMemoryList() bug-fix regression suite explicitly (entries/rootDir/index/enabled required, four per-hook flags deliberately not required), plus the real HTTP adapters, the fake connector catalogue, and the real browser pending-auth/notify bridges.
Documents PR #5228's source/SHA, the pre-existing-bug finding, the fetchMemoryList() fix, the connector-reconciliation-reducer reuse decision, the real-vs-fake transport split, and everything intentionally not ported (host-owned orchestrator/subscriptions).
Adds useMemoryFlash/Navigation/Config, useMemoryEntries, useMemoryExtractions hook tests and MemoryAdvancedModal/EntryCard/ ExtractionCard/HooksPanel/HowPanel/List/ManualEditor component tests, each including a real I18nProvider-mounted translation-proof test. Also fixes a systemic exactOptionalPropertyTypes gap in types.ts (optional fields needed explicit , not just , to accept the field-omitted-vs-explicitly-undefined test fixtures these tests construct), and registers the feature in the package's top-level barrel (src/index.ts) plus its completeness test.
…ryConnectedPanel, render-markdown) All 412 tests green across 20 files; typecheck clean. Fixes two exactOptionalPropertyTypes gaps found while wiring these in (MemoryConnectedPanel's onOpenConnectors prop, and two test fixtures' widened auth.kind literal types).
…emory Adds the still-missing branches: requiredNonNullField's present-but-null case, the fake connector port's no-accountLabel status derivation, a blocked-sessionStorage write, the editor-focus/scroll effect (attaching real DOM refs before triggering it, rather than treating it as hook-level-untestable), and the suggestion-source toolTitle-only fallback. Adds a features/memory own-barrel completeness smoke test. Refactors useMemoryExtractions.hooks.ts's reloadExtractions() off a try/finally (which carried a structurally-unreachable branch, since its bare catch block never itself throws) onto explicit per-exit cleanup — behavior-preserving, not a logic change. Aggregate: 2616/2616 statements, 993/993 branches, 120/120 functions, 2616/2616 lines -- 100% on every metric, every file.
'@open-design/contracts' literal reworded to 'OD contracts-package', matching the same convention already used elsewhere in this package.
…-map.md 423 tests/21 files green, 100% coverage on all 4 metrics aggregate and per-file, monorepo typecheck confirmed regression-free against pre-existing unrelated breakage, purity grep clean, pnpm guard green.
leonaburime-ucla
marked this pull request as ready for review
July 18, 2026 15:21
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.
Summary
Ports the memory feature (saved-memory list/editor, extraction-history stream, connector-sourced memory suggestions) into
packages/ui/src/features/memory/, followingdocs/jini-port/god-components-extraction-plan.md's Consolidation map and thefixing-open-design-webskill's vertical-slice discipline.nexu-io/open-design, "refactor(web): decompose MemorySection into a features/memory vertical slice" — closed 2026-07-15 without merging. Pinned at commitd695f1e0f2b85a032aa7ce4895a3eb764cb1b65d(SHA verified viagit fetchbefore any edit).git showagainst the original 2,636-line monolith that every bug class already existed there — the decomposition exposed pre-existing, zero-coverage bugs, it didn't introduce them. The PR was closed because the review cycle felt endless, not because the approach was rejected (the maintainer's own last comment agrees the bugs were pre-existing).fetchMemoryList()validated only thatentrieswas present on a 2xx response, even thoughenabled/rootDir/indexwere all consumed elsewhere with no fallback. Fixed as part of this port (seedependencies.tsand the before/after insource-map.md), with a dedicated regression suite reproducing the exact malformed-response shape from the bug report.What shipped
types.ts/constants.ts/rules.ts/ports.ts/dependencies.ts/formatters.ts/async-commit-guard.ts/index.tsat the feature's top level,react/{hooks,components}/for everything importing React (this package's current layout convention).MemoryHooksPanelfolded in from a separate single-consumer OD file.useT()per this package's i18n policy, with realI18nProvider-mounted translation-proof tests.rules.tsimports the already-shipped, already-generifiedmergeConnectors/applyConnectorStatuses/hasConnectorStatusChangesfromfeatures/connectors(confirmed identical to ODmain'sconnectors-state.ts, the actual origin of this piece — not PR #5228, whose ownrules.tscomment calls its version "convenience duplication"). Full reasoning insource-map.md.render-markdown.tsx(micromark-based) replacing OD's out-of-scope 2,881-lineruntime/markdown.tsx./api/memory*REST surface — a deliberate, disclosed deviation fromfeatures/connectors' fake-only precedent, since this bug fix needed a real, testable adapter and the surface has no third-party vendor coupling to avoid. The connector-catalogue transport still fakes by default, matchingfeatures/connectors' own reasoning.Validation
pnpm --filter @jini/ui typecheck: clean.pnpm --filter @jini/ui exec vitest run src/features/memory: 423 tests, 21 files, all green./* v8 ignore */. The one genuine dead branch found (atry/finallywhose barecatchcould never itself throw) was refactored away, not suppressed.Open Design/OD_/--od-stamp//tmp/open-design/@open-design//open-design.ai/openDesignDesktop, plus a stricterod-/composiopass): clean.pnpm guard(repo root): green.pnpm -r --no-bail run typecheck: only pre-existing, unrelated failures already documented insource-map.md(stub packages missingtsconfig.json;daemon/deployneeding an unbuiltdist/) —@jini/uiand every other real package typecheck clean.Full provenance note (source, what happened, the fix, the connector-reducer decision, what's intentionally not ported) is in
packages/ui/source-map.md's newfeatures/memory/section.Surface area
New package content only (
packages/ui/src/features/memory/**,packages/ui/src/index.ts/index.test.tsregistration,packages/ui/README.md,packages/ui/source-map.md). No existing files changed beyond registering the new feature in the package's top-level barrel + its completeness test.Generated by Claude Code