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 site manager view and sidebar #1661

Merged
merged 49 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4644ba0
Update ws dependency
bgrgicak Jul 31, 2024
742e68e
Move main content into a view
bgrgicak Jul 31, 2024
ed0b88a
Add site manager view
bgrgicak Jul 31, 2024
4272269
Load site manager if flag set to true
bgrgicak Jul 31, 2024
3150b30
Merge branch 'trunk' into add/website-view-switcher
bgrgicak Jul 31, 2024
53967e4
Open site manager from site view
bgrgicak Aug 1, 2024
1d1f3fb
Add sidebar site switching
bgrgicak Aug 1, 2024
7f2dbe7
Responsive sidebar
bgrgicak Aug 1, 2024
cca77fd
Fix type issue
bgrgicak Aug 1, 2024
09a4d16
Add resources
bgrgicak Aug 1, 2024
f59de26
Read sites from OPFS
bgrgicak Aug 1, 2024
0c5b031
Update comment
bgrgicak Aug 1, 2024
c937e00
Merge branch 'trunk' into add/website-view-switcher
bgrgicak Aug 1, 2024
58022b7
Change view query string
bgrgicak Aug 1, 2024
f2eed46
Update packages/playground/website/src/components/browser-chrome/inde…
bgrgicak Aug 1, 2024
58e076b
Apply suggestions from code review
bgrgicak Aug 1, 2024
b6c3ba3
Fix sidebar responsive issue
bgrgicak Aug 1, 2024
cc9e90b
Capitalize name
bgrgicak Aug 1, 2024
0ccc318
Unrelated open error report links in a new tab
bgrgicak Aug 1, 2024
d69fe76
Update WordPress packages
bgrgicak Aug 5, 2024
3206084
Merge branch 'trunk' into update/wordpress-packages
bgrgicak Aug 5, 2024
16b4875
Merge branch 'update/wordpress-packages' into add/website-view-switcher
bgrgicak Aug 5, 2024
8817d59
Merge branch 'update/wordpress-packages' into add/website-view-switcher
bgrgicak Aug 5, 2024
4f5700d
Use Navigator for views
bgrgicak Aug 5, 2024
db154de
Matching animation time
bgrgicak Aug 5, 2024
618afa7
Add borders
bgrgicak Aug 5, 2024
5cb582a
Responsive issues
bgrgicak Aug 5, 2024
3914f5b
Fix typo
bgrgicak Aug 5, 2024
87d5fff
Merge branch 'trunk' into add/website-view-switcher
bgrgicak Aug 5, 2024
ba559c5
Fix site manager responsive
bgrgicak Aug 5, 2024
4303ded
Remove editor component
bgrgicak Aug 5, 2024
921df43
Update header and nav to use WordPress components
bgrgicak Aug 6, 2024
377a42e
Replace remaining sidebar components
bgrgicak Aug 6, 2024
0676c79
Replace default icon
bgrgicak Aug 7, 2024
9448b3a
Fix site-view radius
bgrgicak Aug 7, 2024
3b0c7c3
Make entire sidebar scrollable
bgrgicak Aug 7, 2024
e3c7bb4
Remove extra titles
bgrgicak Aug 7, 2024
d9d1ed2
Move menu icon to new component
bgrgicak Aug 7, 2024
3728dd2
Disable logo clicks
bgrgicak Aug 7, 2024
c23040b
Fix animation
bgrgicak Aug 7, 2024
9503c35
Change site on sidebar item click
bgrgicak Aug 7, 2024
47d436f
Small css changes
bgrgicak Aug 7, 2024
84176fd
Merge branch 'trunk' into add/website-view-switcher
brandonpayton Aug 7, 2024
291c12a
Add comment length fixes to site-view
brandonpayton Aug 7, 2024
edacf40
Add ESLint rules to limit comment width (#1613)
bgrgicak Aug 6, 2024
eff01f1
Return to site view on click
bgrgicak Aug 8, 2024
a8f3078
Small css fixes
bgrgicak Aug 8, 2024
454ab61
Update menu button style
bgrgicak Aug 8, 2024
463b2eb
Refactor header
bgrgicak Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,64 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v0.9.28] (2024-08-05)
## [v0.9.28] (2024-08-05)

### Blueprints

- Add support for loading wpCli without running blueprint steps. ([#1629](https://github.com/WordPress/wordpress-playground/pull/1629))
- Add support for loading wpCli without running blueprint steps. ([#1629](https://github.com/WordPress/wordpress-playground/pull/1629))

### Documentation

- Blueprints: Add resetData step to documentation. ([#1658](https://github.com/WordPress/wordpress-playground/pull/1658))
- Docs: Redirect from /docs to https://wordpress.github.io/wordpress-playground. ([#1671](https://github.com/WordPress/wordpress-playground/pull/1671))
- Blueprints: Add resetData step to documentation. ([#1658](https://github.com/WordPress/wordpress-playground/pull/1658))
- Docs: Redirect from /docs to https://wordpress.github.io/wordpress-playground. ([#1671](https://github.com/WordPress/wordpress-playground/pull/1671))

### Website

- Suppress unavoidable Deprecated notices - Networking. ([#1660](https://github.com/WordPress/wordpress-playground/pull/1660))
- UI: Explain the Logs modal. ([#1666](https://github.com/WordPress/wordpress-playground/pull/1666))
- Suppress unavoidable Deprecated notices - Networking. ([#1660](https://github.com/WordPress/wordpress-playground/pull/1660))
- UI: Explain the Logs modal. ([#1666](https://github.com/WordPress/wordpress-playground/pull/1666))

#### Blueprints

- Precompile Ajv Blueprint validator to avoid CSP issues. ([#1649](https://github.com/WordPress/wordpress-playground/pull/1649))
- Precompile Ajv Blueprint validator to avoid CSP issues. ([#1649](https://github.com/WordPress/wordpress-playground/pull/1649))

### Internal

- Reinstantiate Changelog generation in GitHub CI. ([#1657](https://github.com/WordPress/wordpress-playground/pull/1657))
- Reinstantiate Changelog generation in GitHub CI. ([#1657](https://github.com/WordPress/wordpress-playground/pull/1657))

### Various

- Rollback artifact creation to enable downloading a pre-built package …. ([#1624](https://github.com/WordPress/wordpress-playground/pull/1624))
- Update WordPress packages. ([#1672](https://github.com/WordPress/wordpress-playground/pull/1672))
- Update `ws` package version to fix DOS vulnerability. ([#1635](https://github.com/WordPress/wordpress-playground/pull/1635))
- Rollback artifact creation to enable downloading a pre-built package …. ([#1624](https://github.com/WordPress/wordpress-playground/pull/1624))
- Update WordPress packages. ([#1672](https://github.com/WordPress/wordpress-playground/pull/1672))
- Update `ws` package version to fix DOS vulnerability. ([#1635](https://github.com/WordPress/wordpress-playground/pull/1635))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @brandonpayton @PiotrPress


## [v0.9.27] (2024-07-29)
## [v0.9.27] (2024-07-29)

### Enhancements

- Support offline mode after the first Playground page load. ([#1643](https://github.com/WordPress/wordpress-playground/pull/1643))
- Support offline mode after the first Playground page load. ([#1643](https://github.com/WordPress/wordpress-playground/pull/1643))

### Devrel

- Remove puzzle app package. ([#1642](https://github.com/WordPress/wordpress-playground/pull/1642))
- Remove puzzle app package. ([#1642](https://github.com/WordPress/wordpress-playground/pull/1642))

### PHP WebAssembly

- Cache Playground assets to enable offline support. ([#1535](https://github.com/WordPress/wordpress-playground/pull/1535))
- Rotate PHP runtime after runtime crash. ([#1628](https://github.com/WordPress/wordpress-playground/pull/1628))
- Throw error when PHP run() receives no code to run. ([#1646](https://github.com/WordPress/wordpress-playground/pull/1646))
- Cache Playground assets to enable offline support. ([#1535](https://github.com/WordPress/wordpress-playground/pull/1535))
- Rotate PHP runtime after runtime crash. ([#1628](https://github.com/WordPress/wordpress-playground/pull/1628))
- Throw error when PHP run() receives no code to run. ([#1646](https://github.com/WordPress/wordpress-playground/pull/1646))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @brandonpayton


## [v0.9.26] (2024-07-22)

### Blueprints
Expand Down
36 changes: 17 additions & 19 deletions packages/docs/site/docs/17-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,64 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v0.9.28] (2024-08-05)
## [v0.9.28] (2024-08-05)

### Blueprints

- Add support for loading wpCli without running blueprint steps. ([#1629](https://github.com/WordPress/wordpress-playground/pull/1629))
- Add support for loading wpCli without running blueprint steps. ([#1629](https://github.com/WordPress/wordpress-playground/pull/1629))

### Documentation

- Blueprints: Add resetData step to documentation. ([#1658](https://github.com/WordPress/wordpress-playground/pull/1658))
- Docs: Redirect from /docs to https://wordpress.github.io/wordpress-playground. ([#1671](https://github.com/WordPress/wordpress-playground/pull/1671))
- Blueprints: Add resetData step to documentation. ([#1658](https://github.com/WordPress/wordpress-playground/pull/1658))
- Docs: Redirect from /docs to https://wordpress.github.io/wordpress-playground. ([#1671](https://github.com/WordPress/wordpress-playground/pull/1671))

### Website

- Suppress unavoidable Deprecated notices - Networking. ([#1660](https://github.com/WordPress/wordpress-playground/pull/1660))
- UI: Explain the Logs modal. ([#1666](https://github.com/WordPress/wordpress-playground/pull/1666))
- Suppress unavoidable Deprecated notices - Networking. ([#1660](https://github.com/WordPress/wordpress-playground/pull/1660))
- UI: Explain the Logs modal. ([#1666](https://github.com/WordPress/wordpress-playground/pull/1666))

#### Blueprints

- Precompile Ajv Blueprint validator to avoid CSP issues. ([#1649](https://github.com/WordPress/wordpress-playground/pull/1649))
- Precompile Ajv Blueprint validator to avoid CSP issues. ([#1649](https://github.com/WordPress/wordpress-playground/pull/1649))

### Internal

- Reinstantiate Changelog generation in GitHub CI. ([#1657](https://github.com/WordPress/wordpress-playground/pull/1657))
- Reinstantiate Changelog generation in GitHub CI. ([#1657](https://github.com/WordPress/wordpress-playground/pull/1657))

### Various

- Rollback artifact creation to enable downloading a pre-built package …. ([#1624](https://github.com/WordPress/wordpress-playground/pull/1624))
- Update WordPress packages. ([#1672](https://github.com/WordPress/wordpress-playground/pull/1672))
- Update `ws` package version to fix DOS vulnerability. ([#1635](https://github.com/WordPress/wordpress-playground/pull/1635))
- Rollback artifact creation to enable downloading a pre-built package …. ([#1624](https://github.com/WordPress/wordpress-playground/pull/1624))
- Update WordPress packages. ([#1672](https://github.com/WordPress/wordpress-playground/pull/1672))
- Update `ws` package version to fix DOS vulnerability. ([#1635](https://github.com/WordPress/wordpress-playground/pull/1635))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @brandonpayton @PiotrPress


## [v0.9.27] (2024-07-29)
## [v0.9.27] (2024-07-29)

### Enhancements

- Support offline mode after the first Playground page load. ([#1643](https://github.com/WordPress/wordpress-playground/pull/1643))
- Support offline mode after the first Playground page load. ([#1643](https://github.com/WordPress/wordpress-playground/pull/1643))

### Devrel

- Remove puzzle app package. ([#1642](https://github.com/WordPress/wordpress-playground/pull/1642))
- Remove puzzle app package. ([#1642](https://github.com/WordPress/wordpress-playground/pull/1642))

### PHP WebAssembly

- Cache Playground assets to enable offline support. ([#1535](https://github.com/WordPress/wordpress-playground/pull/1535))
- Rotate PHP runtime after runtime crash. ([#1628](https://github.com/WordPress/wordpress-playground/pull/1628))
- Throw error when PHP run() receives no code to run. ([#1646](https://github.com/WordPress/wordpress-playground/pull/1646))
- Cache Playground assets to enable offline support. ([#1535](https://github.com/WordPress/wordpress-playground/pull/1535))
- Rotate PHP runtime after runtime crash. ([#1628](https://github.com/WordPress/wordpress-playground/pull/1628))
- Throw error when PHP run() receives no code to run. ([#1646](https://github.com/WordPress/wordpress-playground/pull/1646))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @brandonpayton


## [v0.9.26] (2024-07-22)

### Blueprints
Expand Down
21 changes: 21 additions & 0 deletions packages/playground/website/public/site-manager-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 39 additions & 12 deletions packages/playground/website/src/components/browser-chrome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import css from './style.module.css';
import AddressBar from '../address-bar';
import { close } from '@wordpress/icons';
import classNames from 'classnames';
import { OpenSiteManagerButton } from '../open-site-manager-button';

interface BrowserChromeProps {
children?: React.ReactNode;
toolbarButtons?: Array<React.ReactElement | false | null>;
url?: string;
showAddressBar?: boolean;
onUrlChange?: (url: string) => void;
hideToolbar?: boolean;
className?: string;
}

export default function BrowserChrome({
Expand All @@ -18,6 +21,8 @@ export default function BrowserChrome({
onUrlChange,
showAddressBar = true,
toolbarButtons,
hideToolbar,
className,
}: BrowserChromeProps) {
const addressBarClass = classNames(css.addressBarSlot, {
[css.isHidden]: !showAddressBar,
Expand All @@ -43,20 +48,42 @@ export default function BrowserChrome({
[css.isHidden]: noticeHidden,
});

/**
* Temporary feature flag to enable the site manager
* while using browser storage.
*
* TODO: Remove this once the site manager supports all storage options.
*/
const query = new URLSearchParams(window.location.search);
const showSiteManager = query.get('storage') === 'browser';

return (
<div className={wrapperClass} data-cy="simulated-browser">
<div className={css.window}>
<header className={css.toolbar} aria-label="Playground toolbar">
<div
className={`${wrapperClass} ${className}`}
data-cy="simulated-browser"
>
<div className={`${css.window} browser-chrome-window`}>
<header
className={`${css.toolbar} ${
showSiteManager ? css.hasSiteManager : ''
} ${hideToolbar ? css.toolbarHidden : ''}`}
aria-label="Playground toolbar"
>
<div className={css.windowControls}>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
{showSiteManager && <OpenSiteManagerButton />}
{!showSiteManager && (
<>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
<div
className={`${css.windowControl} ${css.isNeutral}`}
></div>
</>
)}
</div>

<div className={addressBarClass}>
Expand Down
Loading
Loading