Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to name gist #2184

Open
darinkrauss opened this issue Nov 5, 2024 · 5 comments
Open

Add ability to name gist #2184

darinkrauss opened this issue Nov 5, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@darinkrauss
Copy link

Description

Please add the ability to name a gist. If Proxyman queries the user for a name before creating the gist, then Proxyman can add an empty file in the gist with the filename using the queried name plus a single space prefix (e.g. " My Title"). The resulting gist should use this for its title. Admittedly a bit of hack, but until GitHub adds a better option, this is what we have.

Why this feature/change is important?

A gist name of "/[1] Request: GET - my.server.com - \v1\test" isn't particularly useful for me. I'd like the name to be short description of the requests/responses captured so I can keep track of them and also share it publicly.

@darinkrauss darinkrauss added the enhancement New feature or request label Nov 5, 2024
@NghiaTranUIT
Copy link
Member

make sense, I will add a text field to allow you to edit the name before publishing. The default is our naming. You can freely edit it

Please note that the Gist name is strict, some characters are not allow, such as /, so I have to use \

@NghiaTranUIT NghiaTranUIT self-assigned this Nov 5, 2024
@NghiaTranUIT NghiaTranUIT added this to the 5.11.0 milestone Nov 5, 2024
@NghiaTranUIT
Copy link
Member

@darinkrauss let's try to use this beta build: https://download.proxyman.io/beta/Proxyman_5.10.0_allow_editing_Gist_name.dmg

Please note that it's a prefixed name, because

  • Gist API doesn't allow changing the name of gist. It picks the name of the first file as a name.
  • Prefixed name because adding the host and path is meaningful, so it's easier to read and search through, especially if we export multiple requests/responses
    For example:
missing data - [1] Request: POST - www.producthunt.com - \frontend\graphql

@darinkrauss
Copy link
Author

@NghiaTranUIT Looking good! I see how you prefixed all of the file names with the user-entered name.

I see all of the files added to the gist are, by default (without the user-entered name), prefixed with the request number. For example, "[1]".

Therefore, would it be possible to do the following?

  1. Pre-populate the default gist name in the dialog. (That is the file that contains the request bytes from the first request.
  2. Allow the user to entirely replace, modify, or keep the gist name.
  3. Force prefix the gist name with any ASCII character before [ (the guaranteed first character of all other files in the gist). Some prefix character possibilities include space, colon, etc.

OTOH, playing around with the gist a bit, I now see how I can edit the gist and manually add an empty file using the above prefix scheme and it changes the title of the gist. It does bump the version of the gist, of course. The only thing it apparently cannot do is prefix with a space (as that appears to be stripped when I save the gist again).

Thoughts?

@NghiaTranUIT
Copy link
Member

[1], [2] means the ID of the request.

I only support prefixed names because if the user allows changing the name, it's impossible to know what request/response if we share a bunch of requests, for example, 10-20 requests. I tried and it's hard to determine what Request/Response is -> Bad UX

If it's a prefix name, it's much easier to know what Request and Response is

@darinkrauss
Copy link
Author

Sorry, I didn't explain myself clearly above.

I think the names of the individual request and response files are fine as-is. My suggestion was to simply add a new file whose first ASCII character comes before '[' so it is chosen by GitHub to be the "title" file. (According to GitHub, the name of the gist is the name of the first file in asciibetical order.)

Here is an example gist I hand-made, https://gist.github.com/darinkrauss/01930857ef39b873a7243806c756e0b9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants