Skip to content

Add checkbox for query / body / cookie - #9

Closed
swarfte wants to merge 10 commits into
mainfrom
dev
Closed

Add checkbox for query / body / cookie#9
swarfte wants to merge 10 commits into
mainfrom
dev

Conversation

@swarfte

@swarfte swarfte commented May 31, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several enhancements to the payload configuration and request preview features, focusing on improved parameter management and the addition of cookie handling. The changes enable users to manage visible and hidden query, body, and cookie parameters, and to include cookies in request previews. The UI is updated to support these features, providing more granular control over request construction.

The most important changes are:

Payload Parameter Management Enhancements:

  • Added support for "enabled" (visible) and "hidden" states to query, body, and cookie parameters, allowing users to selectively include or exclude parameters in requests. This includes new parsing, serialization, and UI controls for managing parameter visibility. [1] [2] [3]
  • Updated the internal state and profile storage to persist both enabled and hidden parameters for queries, bodies, and cookies, ensuring consistent behavior across profile switches and reloads. [1] [2]

Cookie Support:

  • Introduced a new "Cookie" payload mode, including UI for adding, enabling/disabling, and removing cookie parameters, as well as parsing and serializing cookie strings. [1] [2] [3] [4] [5]
  • Updated the request preview logic to include the Cookie header when cookies are present in the configuration.

UI and Usability Improvements:

  • Added a persistent GitHub repository link to the top-right of the application for quick access to the project source.
  • Improved the payload panel switching logic and memory, ensuring the active panel is restored per profile and that the UI reflects the current payload mode accurately. [1] [2] [3] [4] [5]

These changes provide users with fine-grained control over request construction, especially for complex scenarios involving cookies and conditional parameter inclusion.

swarfte added 10 commits May 31, 2026 14:10
Add vite-plugin-checker to dev dependencies and enable it in vite.config.ts (vueTsc: true) so Vite runs TypeScript/template checks during development. Update package.json and package-lock.json accordingly. Also remove an unused ClipboardDocumentIcon import from ProfileArea.vue.
Adjust contextmenu event modifiers in ProfileArea.vue to prevent menu conflicts: removed .self on the sidebar handler and added .stop.prevent to folder, profile and empty-state handlers so their right-click events don't bubble up to the sidebar. Ensures the correct context menu is shown depending on where the user right-clicks.
Update App.vue layout: change container alignment from items-start to items-stretch so grid children fill available height, and add bg-gray-50 and h-full to the left column wrapper to give the ProfileArea a full-height, light background. This improves visual consistency and ensures the sidebar spans the full viewport height.
Add Tailwind's `min-h-screen` utility to the left column wrapper so the ProfileArea spans the full viewport height. This fixes layout issues where the sidebar could be shorter than the page when content is limited; no functional changes beyond styling.
Add an absolute-positioned GitHub icon button in the App.vue layout for quick access to the repository. The root container was made relative to allow the button to sit in the top-right (right-3 top-3). The anchor includes accessibility attributes (aria-label, title), opens the repo in a new tab with rel="noopener noreferrer", and uses an inline SVG GitHub logo with Tailwind styling to match the UI.
Remove explicit border, background, text color, shadow and hover utility classes from the top-right GitHub repository anchor in App.vue to simplify its styling and rely on higher-level or default styles.
Introduce a Cookie payload mode and wire cookie data through the UI, model, store, and request preview. PayloadArea.vue: add Cookie tab UI, cookie parameter add/remove handlers, cookieParameters state, parsing from/to profile cookie string, and use activePanel for panel switching. PreviewArea.vue: include Cookie header when cfg.cookie is present for GET and POST request generation. ProfileArea.vue: initialize and reset cookie field for new profiles. models.ts and stores.ts: add cookie property to Profile type and default profile values. This enables editing, persisting, and previewing cookies as part of saved profiles.
Introduce panelMemoryByProfile to remember the last active payload panel for each profile (keyed by profile id). loadCurrentProfile now restores activePanel from this memory (falling back to profile.payloadMode or 'GET'), and switchPayloadMode updates the memory (including when switching to 'Cookie'), ensuring the UI restores the last-used panel per profile.
Add an enabled checkbox per query/body/cookie parameter and persist hidden params separately. Introduces hiddenQuery/hiddenBody/hiddenCookie fields on Profile, updates default profiles in stores, and adjusts UI column layout to accommodate the checkbox. Adds parsing helpers (form-like, text pairs, cookie string), and updates load/save logic to parse enabled vs hidden parameters and serialize them back to profile fields (content-type aware for bodies, JSON/urlencoded/text). Initializes new parameter rows with an enabled flag and ensures updateProfileInStores includes hidden fields.
Copilot AI review requested due to automatic review settings May 31, 2026 08:31
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nc-command-builder Ready Ready Preview, Comment May 31, 2026 8:32am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants