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

Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git #897

Merged
merged 7 commits into from Dec 10, 2018

Conversation

rajinwonderland
Copy link
Contributor

@rajinwonderland rajinwonderland commented Dec 3, 2018

Feature Request: SchemaExplorer Tab


Screenshot

Dark Mode:
darkmode

Light Mode:
lightmode

Changes proposed in this pull request:

  • Creating an ExplorerTab System for Docs, Schema, and any other new features that may be implemented into the Explorer side tab.

  • Renaming Current Schema Tab (DocsExplorer Component) to Docs

  • Adding a Schema Tab that shows the SDL version (Using CodeMirror Component) of the schema

  • Options to Download Schema in either .json or .graphql format within the Schema tab

Proposed File Structure Changes:

src
├── ...
├── components
│   ├── ...
│   ├── Playground
│   │   ├── ...
│   │   ├── DocExplorer //  Directory Containing all DocExplorer Components
│   │   │   ├── ...
│   │   ├── ExplorerTabs // Directory Containing all Tab System Components used by the Side Drawer
│   │   │   ├── SideTab.tsx // The Tab Button Component
│   │   │   └── SideTabs.tsx // The TabContainer Module
│   │   ├── SchemaExplorer // Directory Containing all SchemaExplorer Components
│   │   │   ├── SDLEditor.tsx // CodeMirror editor version of the SDL
│   │   │   ├── SDLTypes // DocExplorer styled version of the SDL
│   │   │   │   ├── SDLDocType.tsx 
│   │   │   │   ├── SDLFieldDoc.tsx
│   │   │   │   ├── SDLStyles.tsx
│   │   │   │   ├── SDLType.tsx
│   │   │   │   └── SDLUnionType.tsx
│   │   │   └── SDLView.tsx // SDL View Component
│   │   ├── ...
│   │   └── util
│   │       ├── ...
│   │       ├── createSDL.ts // Utils for SchemaExplorer Components
│   │       └── ...
│   ├── ...
└── ...

Todos:

  • Add 'schema.disableComments' to settings
  • Review Design
  • Refresh Endpoint Icon Placement
  • Autopolling Schema from endpoint

@CLAassistant
Copy link

CLAassistant commented Dec 3, 2018

CLA assistant check
All committers have signed the CLA.

@huv1k
Copy link
Collaborator

huv1k commented Dec 3, 2018

Great job! 🚀

@rajinwonderland
Copy link
Contributor Author

Implemented Disabled Comments in SDLView

Schema View Screenshot schema.disabledComments: true

screen shot 2018-12-03 at 4 19 12 pm

Settings Screenshot

screen shot 2018-12-03 at 4 22 39 pm

Changes to ISettings Interface on README.md and src/types.ts

interface ISettings {
	'general.betaUpdates': boolean
	'editor.theme': Theme
	'editor.reuseHeaders': boolean
	'tracing.hideTracingResponse': boolean
	'editor.fontSize': number
	'editor.fontFamily': string
	'request.credentials': string
	'schema.disableComments': boolean // defaults to true
}

On src/state/workspace/reducers.ts the defaultSettings has the added attribute of schema.disableComments

... const defaultSettings: ISettings = {
  'general.betaUpdates': false,
  'editor.cursorShape': 'line',
  'editor.fontSize': 14,
  'editor.fontFamily': `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
  'editor.theme': 'dark',
  'editor.reuseHeaders': true,
  'prettier.printWidth': 80,
  'request.credentials': 'omit',
  'tracing.hideTracingResponse': true,
  'schema.disableComments': true
}

@kuldar
Copy link
Contributor

kuldar commented Dec 4, 2018

Hey Raj, thanks for the PR, looking awesome! 🙌 I checked it out and played around with it a little bit locally - few notes I took:

  1. It seems like the left side padding is bit too narrow at the moment - could we increase it by ~20px?

padding


  1. Would it prehaps be better DX if we overflow:scroll the schema, rather than linebreaking? It’s easier to scroll sideways to read more data, than it is to decypher the beginnings and ends of linebreaked code.

screenshot 2018-12-04 at 19 07 20


  1. For the sidebar, let's maybe have a consistent color for both the code and header background. The Playground currently has a lot of boxes and areas as it is, so it helps to reduce the visual noise just a bit. For overflow indicator, we could add a slight dropshadow.

screenshot 2018-12-04 at 19 09 43


  1. Could we also double-check the download button - ideally the height should be the same as the left-hand action buttons. (~30px) and the color bit more toned back.

  2. As for the dropdown itself, I realized I hadn't really clearified the different states, so I mocked a better version to illustrate how the hover states should look like. Could we also have it close on blur/outsideClick?

dropdowns


  1. The last one, I promise 😄 Can we tweak the sizing of the vertical buttons just a bit. (By making the "Docs" button ~20px narrower for example).

screenshot 2018-12-04 at 19 17 28


As for showing/hiding comments - this feels more like a setting than an action. (I can’t imagine people toggling between the states too often). Should we just keep the option in the settings, or do we feel strongly about having a separate UI for that?

(Btw changing the schema comments setting didn't affect my schema when trying out locally for some reason).

@kuldar
Copy link
Contributor

kuldar commented Dec 4, 2018

Oh snap, forgot one 😄 Could we change the wording here to "Search the docs.." instead?
docs-search

@rajinwonderland
Copy link
Contributor Author

Perfect! Thanks @kuldar! Will start working on those specs!

@rajinwonderland
Copy link
Contributor Author

Style Changes & Tweaks

As requested by @kuldar

Comments

  • Separated SDLHeader component into it's own file (originally in SDLTypes/SDLStyles.tsx)

Checklist

  • Increase Editor Padding by 24px
  • Disable Line Breaking on Editor: Allow for overflow scroll
  • SDLHeader style changes
    • Add box-shadow as an overflow indicator
      • box-shadow: 0px 1px 3px rgba(17, 17, 17, 0.1);
    • Fix background color so it matches the editor
  • Fix Height on Download & Option Buttons (32px)
  • Fix Color on Download & Option Buttons (On Figma)
  • Fix Stylings for different states on Download & Option Buttons
  • Close Options on blur/outside click
  • Look into Settings schema.disabledComments on local server
  • Decrease width of Docs by ~20px Change fixed width of 60px to 8px padding
  • Change copy from 'Search the schema...' to 'Search the docs...'

@rajinwonderland
Copy link
Contributor Author

@kuldar for some reason, the cmd+save button isn't working on the Settings editor. I think this may be a deeper issue. Try the Save button to disable the comments for now and let me know if it still persists!

Tab Screenshots: 📷 📸

Theme With Comment W/O Comments Options Button
Light lwc lw oc lwc options
Dark dwc dw oc dw oc options

Docs Screenshot 📜 📓 📸

docs

@kuldar
Copy link
Contributor

kuldar commented Dec 5, 2018

Looking great Raj! 🙌 The comments setting seems to now work as well.

The only nitpick I'd perhaps have is that it looks like the vertical "Docs" button still has quite a lot of padding around it compared to "Schema". But other than that looks good to me! 👍
screenshot 2018-12-05 at 15 24 40

@rajinwonderland
Copy link
Contributor Author

Hey @kuldar agreed. I'll go ahead and see what I can do to fix that!

@rajinwonderland
Copy link
Contributor Author

Hey @kuldar, just added a tabWidth prop to the side tabs based on your figma designs.

Screenshots 📸

Dark Theme

screen shot 2018-12-05 at 11 46 19 am

Light Theme

screen shot 2018-12-05 at 11 47 21 am

@kuldar
Copy link
Contributor

kuldar commented Dec 6, 2018

Awesome, looks good to me! 👍

@schickling
Copy link
Collaborator

A bit more feedback from my side:

  • The spacing for the collapsed tabs seems off

image

  • Let's add additional line-breaks after each item
# change from ...
type AggregateUser {
  count: Int!
}
type BatchPayload {
  count: Long!
}
scalar Long

# to ...
type AggregateUser {
  count: Int!
}

type BatchPayload {
  count: Long!
}

scalar Long

Fix for additional line-breaks after each item
@rajinwonderland
Copy link
Contributor Author

Hey @schickling thanks for the feedback!

Just pushed some changes

  • Fix Tab Spacing in collapsed state
  • Add additional line-breaks after each

Tab Spacing Fix

tabspacing

  • Changed right: -2px to right: 0px on SideTab.tsx styled Tab component

Line Breaking on Schema

With Comments Without Comments
withcomments withoutcomments
  • Added addLineBreaks(sdl: string, commentsDisabled?: boolean) function on createSDL.ts

Note on Comment Linebreaking

I've opted to removed added newlines on comments since the newlines from each comment, but I'm not sure what would be best.

new lines on inline comments

@schickling
Copy link
Collaborator

This looks great. Thanks a lot for the updates. I agree, let's remove the line breaks between fields.

@rajinwonderland
Copy link
Contributor Author

Cool! Line breaks are removed on the fields! 😊

@huv1k
Copy link
Collaborator

huv1k commented Dec 10, 2018

@rajinwonderland Thanks for great work on this PR! 🚀It will be in next release of playground this week.

@huv1k huv1k merged commit ced58ea into graphql:master Dec 10, 2018
risenforward pushed a commit to risenforward/howdyQ that referenced this pull request Dec 18, 2018
…(#897)

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql/graphql-playground#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item
rohit-ravikoti pushed a commit to Novvum/gql-playground that referenced this pull request Jan 7, 2019
huv1k pushed a commit that referenced this pull request Jan 14, 2019
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on #897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* Updates for using 'esc' on keydown to close tabs

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron
huv1k pushed a commit that referenced this pull request Jan 27, 2019
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on #897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on #897 comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* removed questiomark

* removed duplicate funciton

* updated files from upstream

* yarn.lock from upstream

* using printSchema instead of JSON.stringify to compare schemas

* reusing reload icon

* "Refresh to see changes" feature in SCHEMA tab

* disabled animation for polling

* changed polling icon and moved back to right side.

* automatically updating schema view without scrolling when schema updates

* moved reload icon back to the left

* automatically updating schema view without scrolling when schema updates

* more accurate schema diff checking
@huv1k huv1k mentioned this pull request Jan 28, 2019
cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
…graphql#897)

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item
cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* Updates for using 'esc' on keydown to close tabs

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron
cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql#897 comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* removed questiomark

* removed duplicate funciton

* updated files from upstream

* yarn.lock from upstream

* using printSchema instead of JSON.stringify to compare schemas

* reusing reload icon

* "Refresh to see changes" feature in SCHEMA tab

* disabled animation for polling

* changed polling icon and moved back to right side.

* automatically updating schema view without scrolling when schema updates

* moved reload icon back to the left

* automatically updating schema view without scrolling when schema updates

* more accurate schema diff checking
filippbudko added a commit to filippbudko/graphql-playground that referenced this pull request Jan 16, 2023
…(#897)

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql/graphql-playground#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item
filippbudko added a commit to filippbudko/graphql-playground that referenced this pull request Jan 16, 2023
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql/graphql-playground#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* Updates for using 'esc' on keydown to close tabs

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron
filippbudko added a commit to filippbudko/graphql-playground that referenced this pull request Jan 16, 2023
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql/graphql-playground#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql/graphql-playground#897 comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* ugly version is done

* moved icons to the left

* making polling global

* Updates for using 'esc' on keydown to close tabs

* added polling config

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron

* Hiding reload icon if polling is enabled

* * Updated schema polling icon
* Schema only updates in state if it has changed

* code cleanup

* removed questiomark

* removed duplicate funciton

* updated files from upstream

* yarn.lock from upstream

* using printSchema instead of JSON.stringify to compare schemas

* reusing reload icon

* "Refresh to see changes" feature in SCHEMA tab

* disabled animation for polling

* changed polling icon and moved back to right side.

* automatically updating schema view without scrolling when schema updates

* moved reload icon back to the left

* automatically updating schema view without scrolling when schema updates

* more accurate schema diff checking
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.

None yet

5 participants