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

docs: display all signatures #3030

Closed
wants to merge 3 commits into from
Closed

docs: display all signatures #3030

wants to merge 3 commits into from

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Aug 4, 2024

This PR changes the docs by showing all api signatures of a method instead of only the last one.

Single Signature

https://deploy-preview-3030.fakerjs.dev/api/color.html#csssupportedfunction
grafik

Multi Signature

https://deploy-preview-3030.fakerjs.dev/api/color.html#cmyk

  • No Args

    grafik

  • With Options

    grafik

Not sure whether we should merge this first and then find a way to name the signatures or vice versa.

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent labels Aug 4, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Aug 4, 2024
@ST-DDT ST-DDT requested review from a team August 4, 2024 23:12
@ST-DDT ST-DDT self-assigned this Aug 4, 2024
Copy link

netlify bot commented Aug 4, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 9bc9a32
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/66e87e4750ab95000846ca63
😎 Deploy Preview https://deploy-preview-3030.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Aug 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.97%. Comparing base (3e47ee7) to head (9bc9a32).
Report is 37 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #3030    +/-   ##
========================================
  Coverage   99.96%   99.97%            
========================================
  Files        2776     2776            
  Lines      226338   226338            
  Branches      589      943   +354     
========================================
+ Hits       226267   226275     +8     
+ Misses         71       63     -8     

see 1 file with indirect coverage changes

@Shinigami92
Copy link
Member

thoughts: this come with some downsides regarding UX using CTRL+F
also I personally don't like the "style" of the buttons, could we potentially use tabs instead? Maybe some other frameworks do have already something similar (?)

@matthewmayer
Copy link
Contributor

This definitely seems confusing to navigate. There is no way to know what signature you need without clicking on all of them. Having a single table with all the parameters like currently seems more intuitive.

@ST-DDT
Copy link
Member Author

ST-DDT commented Aug 17, 2024

This definitely seems confusing to navigate. There is no way to know what signature you need without clicking on all of them.

That would probably be solved by giving them names.

No Args With Options

Or

String Format Options Decimal Format Options

Having a single table with all the parameters like currently seems more intuitive.

How about greying out the ones not applying to the current signature?
Or limiting the swap to only the signature and examples?


thoughts: this come with some downsides regarding UX using CTRL+F
also I personally don't like the "style" of the buttons, could we potentially use tabs instead? Maybe some other frameworks do have already something similar (?)

Any suggestions?

@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label Aug 17, 2024
@Shinigami92
Copy link
Member

Any suggestions?

I thought about something like this: https://quasar.dev/vue-components/tab-panels#with-qtabs
But even with these, the CTRL+F UX would be missing 🙁

If we dont find something nice that still works in terms of UX, we might even leave as is 🤷

@ST-DDT
Copy link
Member Author

ST-DDT commented Aug 18, 2024

How about horizontal scrolling?
That way it should be searchable.

@Shinigami92
Copy link
Member

How about horizontal scrolling? That way it should be searchable.

maybe, feel free to try and experiment

@ST-DDT
Copy link
Member Author

ST-DDT commented Sep 16, 2024

Horizontal UI results in weird behavior/UX and I wasn't able to make it look good (or visible that you can actually scroll there horizontally).

@xDivisionByZerox Any ideas on how to display multiple signatures?

@xDivisionByZerox
Copy link
Member

@xDivisionByZerox Any ideas on how to display multiple signatures?

I can try to come up with a prototype tomorrow 👍

@matthewmayer
Copy link
Contributor

I'm not really sure showing multiple signatures is necessary. Given most methods have very simple signatures (just passing an options object). Showing a good set of examples is probably easier to quickly grasp than showing all the signatures.

@ST-DDT ST-DDT closed this Oct 12, 2024
@ST-DDT ST-DDT deleted the docs/api/multi-signature branch October 12, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants