show and hide panel

pull/5371/head
bunsenstraat 3 weeks ago
parent 4d047091ba
commit cf6b7bfe47
  1. 9
      apps/remix-ide-e2e/src/helpers/init.ts
  2. 2
      libs/remix-api/src/lib/remix-api.ts
  3. 15
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx

@ -14,6 +14,15 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
.url(url || 'http://127.0.0.1:8080')
.pause(5000)
.switchBrowserTab(0)
// get value from local storage
.execute(function () {
return localStorage.getItem('did_show_popup_panel')
}, [], function (result) {
if (!result.value) {
browser.waitForElementVisible('*[data-id="aiStatusButton"]')
.click('*[data-id="aiStatusButton"]')
}
})
.perform((done) => {
if (!loadPlugin) return done()
browser

@ -17,10 +17,8 @@ import { IRemixAI } from "./plugins/remixai-api"
import { IRemixAID } from "./plugins/remixAIDesktop-api"
import { IMenuIconsApi } from "./plugins/menuicons-api"
import { IDgitPlugin } from "./plugins/dgitplugin-api"
import { Api } from "@remixproject/plugin-utils";
import { IPopupPanelAPI } from "./plugins/popuppanel-api"
export interface ICustomRemixApi extends IRemixApi {
popupPanel: IPopupPanelAPI
dgitApi: IGitApi

@ -9,10 +9,8 @@ import { AppProvider } from './context/provider'
import AppDialogs from './components/modals/dialogs'
import DialogViewPlugin from './components/modals/dialogViewPlugin'
import { appProviderContextType, onLineContext, platformContext } from './context/context'
import { FormattedMessage, IntlProvider } from 'react-intl'
import { CustomTooltip } from '@remix-ui/helper'
import { IntlProvider } from 'react-intl'
import { UsageTypes } from './types'
import { AppState } from './interface'
import { appReducer } from './reducer/app'
import { appInitialState } from './state/app'
@ -45,7 +43,10 @@ const RemixApp = (props: IRemixAppUi) => {
const sidePanelRef = useRef(null)
const pinnedPanelRef = useRef(null)
const [appState, appStateDispatch] = useReducer(appReducer, appInitialState)
const [appState, appStateDispatch] = useReducer(appReducer, {
...appInitialState,
showPopupPanel: !window.localStorage.getItem('did_show_popup_panel')
})
useEffect(() => {
async function activateApp() {
@ -77,6 +78,12 @@ const RemixApp = (props: IRemixAppUi) => {
}
}, [])
useEffect(() => {
if(!appState.showPopupPanel) {
window.localStorage.setItem('did_show_popup_panel', 'true')
}
},[appState.showPopupPanel])
function setListeners() {
props.app.sidePanel.events.on('toggle', () => {
setHideSidePanel((prev) => {

Loading…
Cancel
Save