Skip to content

fix: remove dead preview stubs in NetworkMockEndpointScreen #92

Description

@MaxMichel2

Summary

NetworkMockEndpointScreen carries an unused previewingResponse state variable and an unused onPreviewClick parameter, both dead leftovers from before the preview bottom sheet (PreviewSheetState) was built. This is independent of the OpenAPI migration (tracked in the epic, #72) and can be picked up any time. Good first issue: small, self-contained, purely a deletion.

Current state

In devview-networkmock/src/commonMain/kotlin/com/worldline/devview/networkmock/NetworkMockEndpointScreen.kt:

  • previewingResponse — declared at :96 (var previewingResponse by remember { mutableStateOf<MockResponse?>(value = null) }) with a comment above it reading // Stub for Step 3 — will be replaced with the preview sheet (:95). The preview sheet (PreviewSheetState, NetworkMockEndpointPreviewBottomSheet) now exists and is fully wired via a separate mechanism (previewSheetState, declared at :129-133, driven by onLongClick at :255-258) — previewingResponse is never read anywhere after its declaration.
  • onPreviewClick — a parameter on NetworkMockEndpointScreenContent (:113), populated by NetworkMockEndpointScreen at :101 (onPreviewClick = { previewingResponse = it }), and passed again in the @Preview composable at :312 (onPreviewClick = {}). It's declared but never invoked anywhere in the actual UI — no onClick/onLongClick in the file calls it.

What to build

Delete both, and anything that only exists to feed them:

  • Remove previewingResponse (:96) and its explanatory comment (:95).
  • Remove the onPreviewClick parameter from NetworkMockEndpointScreenContent's signature (:113) and from both call sites (:101, :312).

Acceptance criteria

  • previewingResponse and onPreviewClick no longer exist anywhere in NetworkMockEndpointScreen.kt.
  • The file still compiles and the preview bottom sheet (driven by previewSheetState) continues to work exactly as before — this is a pure deletion of dead code with zero behavior change.
  • detektFull and existing device tests for this screen still pass.

Files likely touched

  • devview-networkmock/src/commonMain/kotlin/com/worldline/devview/networkmock/NetworkMockEndpointScreen.kt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions