Skip to content

feat(web)/request-workspace-panels#119

Merged
andrewmelchor merged 4 commits intomainfrom
feat(web)/request-workspace-panels
Mar 6, 2026
Merged

feat(web)/request-workspace-panels#119
andrewmelchor merged 4 commits intomainfrom
feat(web)/request-workspace-panels

Conversation

@andrewmelchor
Copy link
Copy Markdown
Member

Summary

  • Refactored the packages/web request workspace UI into smaller, focused components without changing behavior.
  • Split the large body panel into mode-specific components (inline, form-data, file) and moved shared body props into a dedicated types.ts.
  • Introduced shared panel building blocks for reusable UI patterns (error banner, draft action header, key/value table/row).
  • Kept backward compatibility by preserving existing panel exports through request-workspace-tab-panels.tsx, now as a thin re-export layer.
  • Removed unused legacy panel prop interfaces that were no longer referenced anywhere.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 6, 2026

Greptile Summary

This PR is a structural refactor of the request workspace UI in packages/web: the large monolithic body panel is split into three focused sub-editors (InlineBodyEditor, FormDataEditor, FileBodyEditor), shared UI building blocks (DraftHeader, ErrorBanner, KeyValueTable/KeyValueRow) are extracted into a panels/shared module, and the top-level barrel (index.ts) is updated to expose both the new names and the legacy RequestWorkspace* aliases via a thin re-export shim. No behavior changes are intended.

  • BodyPanel correctly wraps shouldShowDescription in a reactive getter function (previous feedback addressed).
  • ErrorBanner now accepts message?: string as a plain prop (previous feedback addressed).
  • ErrorBanner is missing role="alert", reducing screen-reader accessibility; inline-editor.tsx already uses this attribute on comparable error divs.
  • KeyValueRow is exported publicly with item: () => RequestDetailsRow (a SolidJS <Index> accessor) — callers outside <Index> must wrap values in an arrow function, which is non-obvious.
  • BodyPanel's <Switch> has no fallback, so an unrecognized requestBodySummary.kind silently renders nothing.

Confidence Score: 4/5

  • This PR is safe to merge — it is a pure UI refactor with no behavior changes and no new data-flow logic.
  • The decomposition is clean, previously flagged reactivity and prop-type issues have been addressed, and the legacy re-export shim maintains backward compatibility. The remaining feedback (missing role="alert", exposed getter-function prop, no Switch fallback) are all style/accessibility concerns that don't affect runtime correctness.
  • panels/shared/error-banner.tsx (accessibility) and panels/shared/key-value-table.tsx (public API of KeyValueRow) deserve a second look before merging.

Important Files Changed

Filename Overview
packages/web/src/components/request-workspace/panels/body/index.tsx New BodyPanel orchestrator that delegates to mode-specific sub-editors. shouldShowDescription is correctly wrapped as a reactive getter. <Switch> has no fallback for unknown body kinds.
packages/web/src/components/request-workspace/panels/shared/error-banner.tsx New shared error-display component. Props correctly typed as message?: string. Missing role="alert" on the error div reduces accessibility for screen-reader users.
packages/web/src/components/request-workspace/panels/shared/key-value-table.tsx Shared key-value table with inline editing. KeyValueRow's item: () => RequestDetailsRow getter prop is idiomatic inside <Index> but awkward as a public API export since external callers must know to wrap values in an arrow function.
packages/web/src/components/request-workspace/request-workspace-tab-panels.tsx Thin re-export shim that maps new component names to RequestWorkspace* legacy aliases. Correctly preserves backward compatibility. No issues found.
packages/web/src/components/request-workspace/index.ts Updated barrel file adds new panel and shared component exports alongside the existing legacy exports. Comment placement is slightly off (// Legacy exports on line 28 sits inline with the preceding block), but no functional issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph index.ts ["index.ts (barrel)"]
        A[BodyPanel]
        B[HeadersPanel]
        C[ParamsPanel]
        D[DraftHeader / ErrorBanner\nKeyValueRow / KeyValueTable]
        E[RequestWorkspaceBodyPanel\nRequestWorkspaceHeadersPanel\nRequestWorkspaceParamsPanel]
    end

    A --> BP["panels/body/index.tsx\n(BodyPanel)"]
    BP --> IE["inline-editor.tsx\n(InlineBodyEditor)"]
    BP --> FE["form-data-editor.tsx\n(FormDataEditor)"]
    BP --> FiE["file-editor.tsx\n(FileBodyEditor)"]
    BP --> SH["panels/shared\n(ErrorBanner)"]

    B --> HP["panels/headers/index.tsx\n(HeadersPanel)"]
    HP --> SH
    HP --> SH2["panels/shared\n(DraftHeader + KeyValueTable)"]

    C --> PP["panels/params/index.tsx\n(ParamsPanel)"]

    E --> RWTP["request-workspace-tab-panels.tsx\n(re-export shim)"]
    RWTP --> BP
    RWTP --> HP
    RWTP --> PP
Loading

Last reviewed commit: a080557

@andrewmelchor andrewmelchor merged commit 2966a45 into main Mar 6, 2026
1 check passed
@andrewmelchor andrewmelchor deleted the feat(web)/request-workspace-panels branch March 6, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant