Extract @opencollection/docs into this repo - #1
Closed
arpit-bruno wants to merge 171 commits into
Closed
Conversation
add: opencollection playground
Add: bru api and style fixes
…or executing user scripts and tests
feat(scripting): implements `QuickJS` sandbox support for executing `scripts/tests`
…pdate build scripts
…d metadata definitions
…ency and visual clarity
…cURL, JavaScript, and Python
…ted color palette for improved readability
* Added disabled badge for not enabled fields * E2E fixed * Comments resolved * Updated the E2E test case with multiple chips
* Add file not found icon
* Increase the restricted width to 100rem
* Complete the unsupported requests type page
* Remove non-http request methods from request dropdown
* Add e2e tests and unit tests
* Fix the regression caused by commenting the methods
* Remove formatting changes
* Remove formatting from files
* Minor issue fixes
* Fix the dependency for useMemo hook
* Review comments along with fixing e2e tests
* Review changes
* test(oc-docs): address PR review on e2e tests
Add a sidebar-item-chevron data-testid and use it in openTreeItem instead of the
.navlink-chevron class selector; add a playground.open(dock) helper and use it
in the query-bar method spec instead of page.goto.
* Replace the deleted RequestDescription with ViewMore component
* fix(oc-docs): finalize unsupported-request redesign wiring and tests
- Wire titleVariant="label" for the playground's unsupported view
- Forward the query-bar-method-select testid to the method MenuDropdown trigger
- Update the e2e page object and specs for the RequestDescription -> ViewMore rename
- Adapt the playground POM methodOptions() to MenuDropdown and simplify openTreeItem
- Refresh sampleCollection websocket docs copy used by e2e assertions
- Drop obsolete getValidClasses tests from common.spec
* refactor(oc-docs): extract TitleLabel into a reusable component
Move the unsupported-request title style out of its local StyledWrapper
into a shared TitleLabel component (mirroring Heading), so the label
typography can be reused elsewhere.
* test(oc-docs): scope the method-menu e2e locator to its dropdown
getByRole('menu') could match any open menu on the page and turn flaky;
target the method dropdown's own surface testid instead.
* revamp the request query bar UI * move request body-type selector into the tab strip and fixes 'No Body' now actually clears the body * resolve request auth stored under the request block * add getRequestAuth cases for request-block auth * center tab labels with symmetric vertical padding * wire post-response variables into the request pane * extract shared post-response variable mappers, * resolve request auth stored under the request block * wire post-response variables into the request pane via shared mappers * clear the legacy root-level body when switching body type * use the shared Heading for the playground request title
…(#114) * fix(oc-docs): dark modal backdrop, full-height bottom sheet, tablet CTA, sidebar method alignment - ModalDock: dark blurred backdrop and neutral shadow (was text-derived, went whitish in dark) - BottomSheetDock: default height fills the viewport instead of stopping at the docs topbar - Topbar: keep the full Open-in-Bruno label on tablet, glyph-only on mobile - Sidebar method badge: widen the column and drop the negative margin so PATCH keeps a gap - Sidebar method badge: baseline-align the badge with the request name * fix(oc-docs): open bottom playground at 75% and re-expand from collapsed on Try The bottom sheet defaults to 75% of the viewport instead of full height, and a Try click re-expands it to that height when it is currently collapsed. * fix(oc-docs): reveal a folder's children when its name is clicked Clicking a folder name now navigates and expands it (expand-only, never collapses), so a folder that was manually collapsed while active re-opens on the next name click instead of only via the chevron. Adds an expandFolder action to the playground slice for the playground sidebar. * fix(oc-docs): use themed shadow token for modal window and drop trailing comma Use var(--shadow-md) for the modal-dock window (matching the shared Modal) instead of a hardcoded rgba, and remove a stray trailing comma in the playground spec import. * fix(oc-docs): use border0 for the playground header bottom border * fix(oc-docs): open bottom playground at 60% instead of 75% * fix(oc-docs): use rem for the sidebar method badge width
* feat(oc-docs): add phone-only device detection (useIsMobilePhone) * feat(oc-docs): let PlaygroundHeader hide the dock switcher * feat(oc-docs): add fullscreen MobileDock playground shell * feat(oc-docs): open the playground fullscreen on phones * test(oc-docs): e2e for fullscreen playground on phones * refactor(oc-docs): drop unused Escape handler from MobileDock Phones have no Escape key, so useEscapeKey was dead weight on the phone-only dock (it was mirrored from ModalDock). useLockBodyScroll stays. * a11y(oc-docs): give MobileDock dialog semantics MobileDock is a fullscreen modal surface (fixed inset:0 + body-scroll-lock), so mark it role=dialog aria-modal aria-label like ModalDock, so screen readers treat the page behind it as inert. * test(oc-docs): factor the phone open URL into a local const
…124) * use the themed Tooltip and fixes multiline values were clipped * restore the request query bar method pill and copy-url button
…U-3881) (#123) * feat(oc-docs): example slug helper, resolver, and pgEx url param (BRU-3881) * feat(oc-docs): deep-link examples in playground and docs via example slug (BRU-3881) * test(oc-docs): e2e for example deep-links, Try-from-example, and testid (BRU-3881) * refactor(oc-docs): fix applyKey NUL separator, memoize slug resolve, review nits (BRU-3881) * consolidate example slug derivation into shared helpers * fix playground dock switch dropping the open example * removed unnecessary usecallback and usememo
… issue in the playground (#126) * Removed two auth modes from auth options and fixed scroll issue in the playground * Scroll issue fix in the playground
…d (#125) * fix (oc-docs): Fix the heading in the request pages in the playground (supported and unsupported pages) * Make the `Untitled Request` to title case
* fix:font consistent with bruno app * test:test:add coverage for prism variable/property token grammar * fix:match Prism JS highlighting to Bruno's CodeMirror colors
* chore: version bump v0.10.0 * chore: oc-schema-explorer deps version bumped * chore: oc/types deps version bumped --------- Co-authored-by: Arpit Bruno <arpit@usebruno.com>
* adds: overview tab to req pane * wip: overview tab required empty-state subheading + wire into collection/folder settings * Add e2e tests * Update unit test * Remove the e2e tests * Reset e2e changes to `main` branch * Remove newly created files --------- Co-authored-by: Vineet Sharma <vineet@usebruno.com>
* fix(oc-docs): address PR #113 MenuDropdown review feedback
- Remove dead Common/RequestHeader (zero importers; the live request
header is PlaygroundView/RequestPane/RequestHeader)
- Convert the Select and VariablesTab dropdown triggers from
<span role="button"> to real <button> so they open on Enter/Space
- Rename MenuDropdown's data-testid prop to the repo's testId
convention, drop the 'menu-dropdown' default and omit the attribute
when unset; migrate all consumers and give QueryBar's method
dropdown an explicit method-select id
- Drop dead CSS carried over from bruno-app in MenuDropdown
- Add aria-haspopup="menu" to custom triggers
- Rename normalizeGroupNameForId to normalizedGroupName
* fix(oc-docs): use listbox semantics for MenuDropdown value pickers
The single-select consumers (Select, method, body-type, variable-type,
assertion-operator) replaced native <select>s, so they need listbox/option
ARIA rather than menu/menuitem. Add an opt-in role prop ('menu' default,
'listbox' for pickers): under listbox the container is role="listbox", rows
are role="option" with aria-selected on every option, and a roving tabindex
gives one tab stop on the selected option. Internal focus/nav queries key off
a stable .menu-dropdown-list class and data-item-id so they work under both
roles, and the trigger's aria-haspopup follows the role.
* test(oc-docs): e2e for MenuDropdown listbox keyboard navigation
Cover the method-select dropdown: open via click and keyboard, arrow-key
navigation, Enter to select and update the trigger, Escape to close, and the
listbox/option roles with aria-selected on the active option.
* fix(oc-docs): give the method select its testId and listbox role
The MenuDropdown testId/role migration missed QueryBar's method picker: it
still passed the removed data-testid prop (rendering no test ids) and kept the
default menu role. Pass testId="method-select" and role="listbox" so it matches
the other single-select value pickers.
Consolidate its e2e onto the dedicated MethodSelect page object: fold the
HTTP-methods-only check into method-select.spec.ts, delete the duplicate
query-bar-methods.spec.ts, and drop its now-unused locators from the playground
page object.
* test(oc-docs): nest method select page object under PlaygroundComponent
The method select renders in the playground query-bar, not on the
standalone request page, so it belongs as a nested component of
PlaygroundComponent (alongside keyValueTable and the script editors)
rather than as a top-level Playwright fixture in pages.fixture.ts.
Tests now reach it via playground.methodSelect.
* fix(oc-docs): keep dropdown menus above the playground docks (port #118)
Give the portaled MenuDropdown panel z-index var(--z-popover) and migrate
EnvSwitcher to render its menu via MenuDropdown (dropping manual Portal/
positioning); normalize the Topbar z-index to var(--z-header).
Cover the fix with a page-level dropdown-stacking e2e. Per the e2e-for-pages/
unit-for-components rule, drop the component-level method-select, env-switcher,
and request-body keyboard e2e (MenuDropdown behavior is unit-tested), and add a
QueryBar unit test asserting it offers only HTTP methods.
…n and theme toggle button (#129) * Changed the placement of opencollection and theme toggle button * Fix E2E test cases * Improved E2E test cases and UI chnages * UI fixes * Comments addressed * Comments addressed * E2E improvement comments addressed
…st (#128) * Fixed data type not taking up while sending the request * Variable data type changes in request * Variable color change * Comments addressed * Comments addressed
…133) Below desktop the search collapses to an icon that opens an overlay. Its positioning was gated on viewport media queries, but the responsive mode is derived from the docs-area width — so when the inline playground shrinks the docs column on a wide window, the overlay fell back to the desktop rule and hung off the left edge of the screen. Drive the collapsed treatment off the shell's docs-area mode via a `collapsed` prop / `data-collapsed` attribute instead of viewport media queries. When collapsed, the field wrapper spans the full reveal row so the absolute panel centers within the docs area rather than on a left-aligned field. Includes token/consistency cleanups in the search + topbar styles (z-index token, scroll region derived from the panel cap, --topbar-height).
* feat(oc-docs): typo-tolerant endpoint search via Fuse.js Replace the hand-rolled subsequence matcher with a Fuse.js (Bitap) index so search tolerates typos (bikling matches billing) and matches whole words contiguously instead of stitching characters across tokens (the "b" of baseUrl no longer lit up when searching "billing"). - Narrow search fields to name, URL and folder chain (drop params and description); Fuse key weights name > url > folder. - Tune threshold to 0.3 to keep real typos while dropping shared-prefix false positives (cursor no longer matches currencies). - Bold the exact matched ranges Fuse reports in each field; the result name is no longer bold by default. - Remove the now-unused fuzzyMatch utility and add fuse.js@^7.5.0. * feat(oc-docs): tolerate adjacent-letter transpositions in search Search also runs adjacent-swap variants of the query so a swap typo on a short word (hotles matches hotels) resolves near-exact, without loosening the Fuse threshold. Records introduced only by a variant are gated to near-exact scores, so the expansion adds recall without reopening prefix-bleed false positives. * test(oc-docs): update search empty-state copy assertion to 'folder' * chore(oc-docs): add fuse.js to the lockfile * refactor(oc-docs): address search review (e2e, types, 1-char UX, guards) - Add e2e covering the new behaviours: a swap-typo correcting to its request, folder-chain text search (not just the filter dropdown), and a single-char query holding the initial prompt. - Treat a query shorter than Fuse's minMatchCharLength as "not typing yet" so the first keystroke keeps the initial prompt instead of a no-results flash. - Skip transposition expansion for long queries (likely pasted, not mistyped). - Type collectMatches ranges as [number, number] tuples, not number[][]. - Drop em-dashes from the search comments and test titles. * style(oc-docs): drop redundant comment in search result styles * test(oc-docs): assert search highlight by bold tag, not class name
…in url bar (#136) Thread the existing sidebarOpen state through the docks into PlaygroundHeader so the sidebar-toggle icon renders its panel column filled (and sets aria-pressed) while the sidebar is open. Remove the pill background from the playground query bar method badge so it matches the docs url bar (colored text, no background).
… fix dark-mode shadow (#132) * fix(oc-docs): dismiss playground overlay sidebar on outside click and fix dark-mode shadow The inline-dock sidebar overlays the view but only closed on navigation, so a click outside it did nothing. Add a backdrop that closes it, mirroring the docs navigation drawer. Also swap the overlay's text-tinted color-mix shadow (which turned whitish in dark mode) for the theme-aware --oc-shadow-md token, drop the doubled border-right in overlay mode, and move the docs drawer onto the same token. * fix(oc-docs): address review, use useClickOutside and z-index tokens for playground overlay Add useClickOutside so the inline-dock sidebar also closes when clicking outside the playground, alongside the backdrop that blocks clicks over the view. Extend the hook with an optional ignoreSelector so the sidebar toggle is not treated as outside (which would reopen it). Replace the hardcoded overlay z-indexes with the --z-sidebar token.
The assertion operator dropdown lists 28 options; the shared MenuDropdown surface was capped at 90vh, which measures the browser viewport rather than the embedded component, so the list spilled past the app. Cap the surface at min(20rem, 90vh) so long lists scroll instead of overflowing.
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.
Moves @opencollection/docs out of the opencollection monorepo into this repo.