-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding rough dashboard for diff results
* Adding rough dashboard for diff results * updating location of docs-differ images * Adding zoom and summary * Updating layout Making the screenshot wrapping div take what available height there is
- Loading branch information
Showing
14 changed files
with
13,079 additions
and
948 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# docs-differ | ||
Created with CodeSandbox | ||
|
||
## Getting Started | ||
Run the following to generate a set of diff versus the base RSP docs site and spin up the comparison tool. | ||
|
||
``` | ||
yarn diff-base <NEW_DOCS_URL> | ||
``` | ||
|
||
The docs differ can be run independently against two user specified url link via: | ||
|
||
``` | ||
yarn run-differ -b <BASE_URL> -c <NEW_URL> | ||
``` | ||
|
||
The dashboard can then be started via: | ||
|
||
``` | ||
yarn start | ||
``` |
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
}, | ||
{ | ||
"src": "logo192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "logo512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
yarn run-differ -b https://react-spectrum.adobe.com/ -c $1 | ||
yarn start |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
defaultTheme, | ||
Flex, | ||
Provider, | ||
Slider, | ||
Text, | ||
View | ||
} from '@adobe/react-spectrum'; | ||
import diffJSON from './docs-differ/diff/diff.json'; | ||
import React, {useState} from 'react'; | ||
|
||
function importAll(r) { | ||
return r.keys().map(r); | ||
} | ||
|
||
const images = importAll(require.context('./docs-differ/diff', false, /\.(png)$/)); | ||
function App() { | ||
let [position, setPosition] = useState(0); | ||
let [zoom, setZoom] = useState(1); | ||
let numImages = images.length; | ||
let imgPath = images[position].default; | ||
let summary = diffJSON.message; | ||
summary = summary?.replace(/Alright, there was | But are they regressions or expected changes \?/g,'') | ||
|
||
return ( | ||
<Provider theme={defaultTheme}> | ||
<Flex direction="column" width="80%" height="100vh" margin="auto"> | ||
<Text marginTop="size-400" UNSAFE_style={{fontWeight: 'bold'}}>Summary: {summary}</Text> | ||
<Slider | ||
marginTop="size-100" | ||
minValue={1} | ||
maxValue={numImages} | ||
value={position + 1} | ||
onChange={(index) => setPosition(index - 1)} | ||
label="Nth image diff displayed" | ||
getValueLabel={(index) => `${index} of ${numImages} changes`} | ||
width="50%" /> | ||
<Flex direction="column" gap="size-200" marginTop="size-600" marginBottom="size-300" minHeight="0px" flex={1}> | ||
<Text UNSAFE_style={{fontWeight: 'bold'}}>File: {imgPath}</Text> | ||
<Slider | ||
label="Zoom" | ||
value={zoom} | ||
onChange={setZoom} | ||
minValue={1} | ||
maxValue={4} /> | ||
<div style={{overflow: 'auto', minHeight: "0px", flex: 1}} tabIndex={0}> | ||
<img | ||
alt={`image diff, file name: ${imgPath}`} | ||
src={imgPath} | ||
style={{ | ||
display: 'block', | ||
maxWidth: '100%', | ||
transform: `scale(${zoom})`, | ||
transformOrigin: '0 0' | ||
}} /> | ||
</div> | ||
</Flex> | ||
</Flex> | ||
</Provider> | ||
); | ||
} | ||
|
||
export default App; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |
Oops, something went wrong.