feat: lazy response loading, version tags and NetworkMock UI rework - #106
Merged
Conversation
The main operation list only ever renders name, method, path, and current state, but NetworkMockViewModel.loadConfiguration() eagerly discovered and decoded every response variant for every operation on app start, then the detail screen loaded the same files again on open. Deletes OperationDescriptor.availableResponses and the eager discovery loop; response variants are now only ever loaded by NetworkMockEndpointViewModel when a detail screen actually opens. Closes #98
Operation.version is extracted from a /v{n}/ path segment via a hardcoded
default regex, giving the UI something to show for the endpoint versioning
the OpenAPI migration replaced the environment-based endpointOverrides
trick with. Purely a display label — RequestMatcher still matches only on
path, method and query params, so /api/v1/x and /api/v2/x remain two
distinct operations exactly as before.
The pattern isn't configurable yet: threading a Regex parameter through
NetworkMock -> NetworkMockInitializer -> MockConfigRepository ->
OpenApiParser is four public signatures for a feature with one consumer.
Deferred to a follow-up issue for non-standard (header/query-versioned)
APIs.
Closes #77
EndpointCard now renders a version chip next to the method/path row when
Operation.version is set. NetworkMockScreen adds a search field (filters by
name, path, or operationId) and a per-tab version filter row of chips
("All" plus each distinct version present), both plain client-side filters
over already-loaded data - no ViewModel change needed. Tabs were already
one-per-spec from the OpenAPI migration.
Closes #79
…ch/filter Regenerates api.txt for devview-networkmock-core and devview-networkmock (devview-networkmock-ktor's surface is unaffected). Updates docs/modules/networkmock-core.md, networkmock-ui.md, networkmock.md, networkmock-workflows.md, both modules' CLAUDE.md, and CHANGELOG.md to describe Operation.version, the metadata/content discovery split, and the search/version-filter UI added by #98, #77, #79.
MaxMichel2
force-pushed
the
feat/networkmock-lazy-ui
branch
from
September 8, 2026 14:16
91775da to
c5ad2f3
Compare
matthiaslao
approved these changes
Sep 8, 2026
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
PR 2 of milestone 0.2.0 (epic #72), stacked on #104 (PR 1,
feat/networkmock-openapi-format). This PR's base branch will auto-retarget tomainonce #104 merges.OperationDescriptorno longer carriesavailableResponses. The main operation list never read them (only name/method/path/current-state), yetNetworkMockViewModel.loadConfiguration()eagerly discovered and decoded every response body for every operation on app start, and the detail screen then loaded the same files again on open. Response variants are now only ever loaded byNetworkMockEndpointViewModelwhen a detail screen actually opens.Operation.version: a display-only tag extracted from a/v{n}/path segment via a hardcoded default regex (e.g./api/v2/x→"v2"). Purely a UI label —RequestMatcherstill matches only on path, method, and query params.AnalyticsScreen's existing filter pattern — no ViewModel changes needed for this part. Tabs were already one-per-spec from PR 1.Deviations from the linked issues (called out per each issue's ACs)
OperationDescriptor.availableResponsesrather than adding a new lightweight descriptor type, since the main screen never read that field in the first place. Added a test that loads a synthetic 300-operation spec through a realMockConfigRepository/NetworkMockViewModeland asserts only the spec file itself is read.Regexacceptance criterion was dropped. Threading aRegexparameter throughNetworkMock→NetworkMockInitializer→MockConfigRepository→OpenApiParseris four public signatures and twoapi.txtfiles for a feature with exactly one consumer (the UI chip). Follow-up issue needed for non-standard (header/query-versioned) APIs.Test plan
:devview-networkmock-core:testAndroidHostTest— green, including new version-tag parse tests:devview-networkmock:testAndroidHostTest— green, including the new lazy-loading regression test:devview-networkmock:connectedAndroidDeviceTest— 42/42 green on a real device (search, version filter, version chip cases):konsist:test— greendetektFull— greenapi.txtregenerated fordevview-networkmock-coreanddevview-networkmock(devview-networkmock-ktorunaffected)Sample API's v1/v2 profile operations, search/version filter narrow the list, detail screen still shows correct response content and delaysCloses #98, #77, #79