Skip to content

Release 0.20.0 #186

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
merged 85 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
65e53cc
Auto connect if only one port available
sebromero Dec 17, 2024
07fa1ce
Display connection status
sebromero Dec 17, 2024
e2784f4
WIP: new file from editor.
ubidefeo Dec 18, 2024
6f025a7
WIP: dialog style.
ubidefeo Dec 18, 2024
f4e9b50
Merge branch 'development' into feature/new-file
ubidefeo Dec 18, 2024
5a7bd0f
WIP: new file dialog box.
ubidefeo Dec 19, 2024
cc93543
Removed ESC from global shortcuts to locally handle it in dialog.
ubidefeo Dec 19, 2024
1a13a43
Brought in bugfix/esc-key-event.
ubidefeo Dec 19, 2024
7fbc40c
Refactor of Tab creation and new file action/button.
ubidefeo Dec 20, 2024
ea5b620
Rework toolbar and CSS.
ubidefeo Dec 20, 2024
49d3ec8
UI font update, CSS update, labels.
ubidefeo Dec 20, 2024
5bf544d
Adjusted toolbar colours (hover) and layout.
ubidefeo Dec 20, 2024
07c7bc2
Split navigation bar actions|views.
ubidefeo Dec 21, 2024
689863a
Fixed file actions buttons states and CSS.
ubidefeo Dec 21, 2024
3a67bbb
Fixed clear state.selectedFiles.
ubidefeo Dec 21, 2024
aede0a2
Separator height adjustments.
ubidefeo Dec 21, 2024
0591824
Removed redundant About menu item.
ubidefeo Dec 21, 2024
a1ea912
Merge pull request #169 from arduino/ui/fix-about
ubidefeo Dec 21, 2024
5321c56
Merge branch 'development' into feature/new-toolbar
ubidefeo Dec 21, 2024
c996824
Toolbar: Reduced space between buttons and label.
ubidefeo Dec 21, 2024
fa82c79
Refactor menu, shortcuts, about window logic.
ubidefeo Dec 21, 2024
cc93603
Merge branch 'bugfix/about-window-issues' into feature/new-toolbar
ubidefeo Dec 21, 2024
ff5ca09
Cleaned CSS typo.
ubidefeo Dec 21, 2024
2791e00
Added New/Save shortcuts to menu.
ubidefeo Dec 21, 2024
22c541f
Merge branch 'feature/auto-connect' into feature/new-toolbar
ubidefeo Dec 21, 2024
838aa6f
Updated Connect shortcut.
ubidefeo Dec 21, 2024
9a05dd9
Cleanup unused code.
ubidefeo Dec 21, 2024
b5c766e
Concealed tooltips.
ubidefeo Dec 21, 2024
be5f149
CSS fix line-height to show underscores in come cases.
ubidefeo Dec 21, 2024
5b81693
Added META+W (close tab) and META+Q (quit).
ubidefeo Dec 21, 2024
3c1fc6c
Added multiple run safeguard to prevent too many Promises from crashi…
ubidefeo Dec 21, 2024
f442628
Transfer operations lock shortcuts. Progress is reset.
ubidefeo Dec 21, 2024
9f2adfd
Reworked panel bar to allow full area drag-to-resize.
ubidefeo Dec 21, 2024
aa91886
Clearing state.selectedFiles on open/view-switch.
ubidefeo Dec 22, 2024
828f21b
Renaming tabs/files will now reflect on the other view.
ubidefeo Dec 22, 2024
64aabf7
Sanitised path in getFullPath() to convert Windows separators to posix.
ubidefeo Dec 22, 2024
e0db436
Merge branch 'bugfix/windows-recursive-upload' into feature/new-toolbar
ubidefeo Dec 22, 2024
bd59f93
Merge pull request #170 from arduino/bugfix/windows-recursive-upload
ubidefeo Dec 23, 2024
2fcb677
Minor adjustments to window size and file list padding.
ubidefeo Dec 26, 2024
74e7115
Merge pull request #171 from arduino/design/window-css-adjustments
ubidefeo Mar 3, 2025
954010b
Fixed auto-connect for FM view and amended text to connect.
ubidefeo Mar 3, 2025
5266f50
Fixed toolbar icon opacity when disabled.
ubidefeo Mar 3, 2025
f7840ab
App views buttons made into segmented control.
ubidefeo Mar 3, 2025
505ba9a
Fixed fonts inconsistencies. Updated woff2 files.
ubidefeo Mar 3, 2025
a8a9307
WIP: migration of actions v3 to v4.
ubidefeo Mar 3, 2025
37100c8
WIP: artifacts v4 upgrade.
ubidefeo Mar 3, 2025
7483819
WIP: artifacts v4 upgrade.
ubidefeo Mar 3, 2025
8eaf584
WIP: artifacts v4 upgrade.
ubidefeo Mar 3, 2025
f68c835
WIP: artifacts v4 upgrade.
ubidefeo Mar 3, 2025
2fc901a
WIP: migrating actions v3 to v4 - universal mac build.
ubidefeo Mar 3, 2025
1f67ee6
Merge branch 'github/actions-v4' into feature/new-toolbar
ubidefeo Mar 3, 2025
6602bf5
Fixed Roboto Mono font for editor view.
ubidefeo Mar 4, 2025
a00649c
Loading files displays overlay and locks UI. Enter enabled in dialogs.
ubidefeo Mar 5, 2025
516d13b
Merge pull request #174 from arduino/github/actions-v4
ubidefeo Mar 5, 2025
b9283e5
Merge pull request #175 from arduino/feature/new-toolbar
ubidefeo Mar 5, 2025
4852de6
Merge branch 'development' into fix/loading-files-overlay
ubidefeo Mar 5, 2025
83e7c5a
Merge pull request #176 from arduino/fix/loading-files-overlay
ubidefeo Mar 5, 2025
6497fc9
Add IPC handlers for opening an app and a URL
sebromero Dec 18, 2024
10f9bf5
Expose function to launch app in main world
sebromero Mar 5, 2025
3ccc723
Add event handler for launching an app
sebromero Dec 18, 2024
f5b23e4
Add button to launch package installer
sebromero Mar 5, 2025
3f2636e
Add label
sebromero Mar 5, 2025
851b10e
Move button to primary toolbar actions
sebromero Mar 5, 2025
b81a84d
Hiding separator on Linux.
ubidefeo Mar 5, 2025
a4ffba4
Merge pull request #164 from arduino/feature/launch-pkg-installer
ubidefeo Mar 5, 2025
5e8abf8
Add explicit check for registered application
sebromero Mar 12, 2025
380b6bd
Forcing stop when switching to File Manager.
ubidefeo Apr 9, 2025
03cc893
Comments and logging cleanup.
ubidefeo Apr 9, 2025
8615b76
Merge pull request #180 from arduino/feature/pkg-launcher-fallback
sebromero Apr 9, 2025
78afa75
Addressed review feedback.
ubidefeo Apr 9, 2025
110193a
Amended return false on duplicate tab alert.
ubidefeo Apr 9, 2025
c58289d
Merge pull request #183 from arduino/fix/stop-on-filemanager-switch
ubidefeo Apr 11, 2025
9b0285a
File Manager view triggers file-list on switch.
ubidefeo Apr 11, 2025
c039ea5
Implemented board root detection (/ or /flash).
ubidefeo Apr 12, 2025
80e37a3
Refactored getRoot with interface for consumer.
ubidefeo Apr 12, 2025
06de27a
Working implementation of Board Root detection.
ubidefeo Apr 13, 2025
0ddffa7
Fixed query selector typo.
ubidefeo Apr 14, 2025
efd8350
Removed .gitignore entry in favour of local personal configuration.
ubidefeo Apr 14, 2025
46dcd65
Amended ununsed signature parameter in get_root().
ubidefeo Apr 14, 2025
f057b15
Amended sleep with comment from Sebastian's feedback.
ubidefeo Apr 15, 2025
1a2b11d
Merge pull request #184 from arduino/fix/filemanager-update-file-list
ubidefeo Apr 15, 2025
f6efe4e
Merge branch 'development' into fix/root-detection
ubidefeo Apr 15, 2025
3915443
Pointing BoardNavigationPath to /flash when it's the default writable…
ubidefeo Apr 15, 2025
953f403
Merge pull request #185 from arduino/fix/root-detection
ubidefeo Apr 24, 2025
65273aa
Bumped version to 0.20.0
ubidefeo Apr 30, 2025
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
49 changes: 30 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ jobs:
matrix:
config:
- os: [self-hosted, windows-sign-pc]
id: windows
- os: ubuntu-latest
- os: macos-13
- os: macos-14
id: linux
- os: macos-latest
id: macos-universal
runs-on: ${{ matrix.config.os }}
timeout-minutes: 90

Expand Down Expand Up @@ -92,9 +94,9 @@ jobs:
npm run build

- name: Upload [GitHub Actions]
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}
name: ${{ env.JOB_TRANSFER_ARTIFACT }}-${{ matrix.config.id }}
path: dist

artifacts:
Expand All @@ -108,26 +110,29 @@ jobs:
artifact:
- path: "*-linux_x64.zip"
name: Arduino-Lab-for-MicroPython_Linux_X86-64
- path: "*-mac_x64.zip"
name: Arduino-Lab-for-MicroPython_macOS_X86-64
- path: "*-mac_arm64.zip"
name: Arduino-Lab-for-MicroPython_macOS_arm-64
id: linux
- path: "*-mac_universal.zip"
name: Arduino-Lab-for-MicroPython_macOS_Universal
id: macos-universal
# - path: "*Windows_64bit.exe"
# name: Windows_X86-64_interactive_installer
# id: windows
# - path: "*Windows_64bit.msi"
# name: Windows_X86-64_MSI
# id: windows
- path: "*-win_x64.zip"
name: Arduino-Lab-for-MicroPython_Windows_X86-64
id: windows

steps:
- name: Download job transfer artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}
name: ${{ env.JOB_TRANSFER_ARTIFACT }}-${{ matrix.artifact.id }}
path: ${{ env.JOB_TRANSFER_ARTIFACT }}

- name: Upload tester build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact.name }}
path: ${{ env.JOB_TRANSFER_ARTIFACT }}/${{ matrix.artifact.path }}
Expand All @@ -137,23 +142,25 @@ jobs:
if: github.repository == 'arduino/lab-micropython-editor' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download [GitHub Actions]
uses: actions/download-artifact@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}
path: ${{ env.JOB_TRANSFER_ARTIFACT }}
path: artifacts

- name: List artifacts
run: ls -R artifacts

- name: Get Tag
id: tag_name
run: |
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Publish Release [GitHub]
uses: svenstaro/upload-release-action@2.2.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: ${{ steps.tag_name.outputs.TAG_NAME }}
file: ${{ env.JOB_TRANSFER_ARTIFACT }}/*
file: artifacts/**/*
tag: ${{ github.ref }}
file_glob: true

Expand All @@ -167,7 +174,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Remove unneeded job transfer artifact
- name: Remove unneeded job transfer artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}
name: |
${{ env.JOB_TRANSFER_ARTIFACT }}-windows
${{ env.JOB_TRANSFER_ARTIFACT }}-linux
${{ env.JOB_TRANSFER_ARTIFACT }}-macos-x64
${{ env.JOB_TRANSFER_ARTIFACT }}-macos-arm64
25 changes: 25 additions & 0 deletions backend/ipc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const fs = require('fs')
const registerMenu = require('./menu.js')
const serial = require('./serial/serial.js').sharedInstance
const { shell } = require('electron');

const {
openFolderDialog,
Expand Down Expand Up @@ -138,6 +139,30 @@ module.exports = function registerIPCHandlers(win, ipcMain, app, dialog) {
registerMenu(win, state)
})

ipcMain.handle('launch-app', async (event, urlScheme) => {
// Launch an external app with a custom protocol
return new Promise((resolve, reject) => {
if(app.getApplicationNameForProtocol(urlScheme) === '') {
resolve(false); // App not installed
return;
}

try {
shell.openExternal(urlScheme).then(() => {
resolve(true); // App opened successfully
}).catch(() => {
resolve(false); // App not installed
});
} catch (err) {
reject(err);
}
});
});

ipcMain.handle('open-url', async (event, url) => {
shell.openExternal(url);
});

win.on('close', (event) => {
console.log('BrowserWindow', 'close')
event.preventDefault()
Expand Down
84 changes: 52 additions & 32 deletions backend/menu.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,49 @@
const { app, Menu } = require('electron')
const { shortcuts, disableShortcuts } = require('./shortcuts.js')
const path = require('path')
const serial = require('./serial/serial.js').sharedInstance
const openAboutWindow = require('about-window').default
const shortcuts = require('./shortcuts.js')

const { type } = require('os')

let appInfoWindow = null

function closeAppInfo(win) {
disableShortcuts(win, false)
appInfoWindow.off('close', () => closeAppInfo(win))
appInfoWindow = null

}
function openAppInfo(win) {
if (appInfoWindow != null) {
appInfoWindow.show()
} else {
appInfoWindow = openAboutWindow({
icon_path: path.resolve(__dirname, '../ui/arduino/media/about_image.png'),
css_path: path.resolve(__dirname, '../ui/arduino/views/about.css'),
copyright: '© Arduino SA 2022',
package_json_dir: path.resolve(__dirname, '..'),
bug_report_url: "https://github.com/arduino/lab-micropython-editor/issues",
bug_link_text: "report an issue",
homepage: "https://labs.arduino.cc",
use_version_info: false,
win_options: {
parent: win,
modal: true,
},
show_close_button: 'Close',
})
appInfoWindow.on('close', () => closeAppInfo(win));
disableShortcuts(win, true)
}
}

module.exports = function registerMenu(win, state = {}) {
const isMac = process.platform === 'darwin'
const template = [
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about'},
{ type: 'separator' },
{ type: 'separator' },
{ role: 'hide', accelerator: 'CmdOrCtrl+Shift+H' },
{ role: 'hideOthers' },
Expand All @@ -24,7 +55,22 @@ module.exports = function registerMenu(win, state = {}) {
{
label: 'File',
submenu: [
isMac ? { role: 'close' } : { role: 'quit' }
{ label: 'New',
accelerator: shortcuts.menu.NEW,
enabled: state.view === 'editor',
click: () => win.webContents.send('shortcut-cmd', shortcuts.global.NEW)
},
{ label: 'Save',
accelerator: shortcuts.menu.SAVE,
enabled: state.view === 'editor',
click: () => win.webContents.send('shortcut-cmd', shortcuts.global.SAVE)
},
{ label: 'Close tab',
accelerator: 'CmdOrCtrl+W',
enabled: state.view === 'editor',
click: () => win.webContents.send('shortcut-cmd', shortcuts.global.CLOSE)
},
{ role: 'quit' }
]
},
{
Expand Down Expand Up @@ -167,41 +213,15 @@ module.exports = function registerMenu(win, state = {}) {
}
},
{
label:'Info about this app',
click: () => {
openAboutWindow({
icon_path: path.resolve(__dirname, '../ui/arduino/media/about_image.png'),
css_path: path.resolve(__dirname, '../ui/arduino/views/about.css'),
copyright: '© Arduino SA 2022',
package_json_dir: path.resolve(__dirname, '..'),
bug_report_url: "https://github.com/arduino/lab-micropython-editor/issues",
bug_link_text: "report an issue",
homepage: "https://labs.arduino.cc",
use_version_info: false,
win_options: {
parent: win,
modal: true,
},
show_close_button: 'Close',
})
}
label:'About Arduino Lab for MicroPython',
click: () => { openAppInfo(win) }
},
]
}
]

const menu = Menu.buildFromTemplate(template)

app.setAboutPanelOptions({
applicationName: app.name,
applicationVersion: app.getVersion(),
copyright: app.copyright,
credits: '(See "Info about this app" in the Help menu)',
authors: ['Arduino'],
website: 'https://arduino.cc',
iconPath: path.join(__dirname, '../assets/image.png'),
})

Menu.setApplicationMenu(menu)

}
2 changes: 1 addition & 1 deletion backend/serial/serial-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const SerialBridge = {
return path.posix.join(navigation, target)
},
getFullPath: (root, navigation, file) => {
return path.posix.join(root, navigation, file)
return path.posix.join(root, navigation.replaceAll(path.win32.sep, path.posix.sep), file.replaceAll(path.win32.sep, path.posix.sep))
},
getParentPath: (navigation) => {
return path.posix.dirname(navigation)
Expand Down
27 changes: 22 additions & 5 deletions backend/shortcuts.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
module.exports = {
const { globalShortcut } = require('electron')
let shortcutsActive = false
const shortcuts = {
global: {
CLOSE: 'CommandOrControl+W',
CONNECT: 'CommandOrControl+Shift+C',
DISCONNECT: 'CommandOrControl+Shift+D',
SAVE: 'CommandOrControl+S',
RUN: 'CommandOrControl+R',
RUN_SELECTION: 'CommandOrControl+Alt+R',
RUN_SELECTION_WL: 'CommandOrControl+Alt+S',
STOP: 'CommandOrControl+H',
RESET: 'CommandOrControl+Shift+R',
NEW: 'CommandOrControl+N',
SAVE: 'CommandOrControl+S',
CLEAR_TERMINAL: 'CommandOrControl+L',
EDITOR_VIEW: 'CommandOrControl+Alt+1',
FILES_VIEW: 'CommandOrControl+Alt+2',
ESC: 'Escape'
},
menu: {
CLOSE: 'CmdOrCtrl+W',
CONNECT: 'CmdOrCtrl+Shift+C',
DISCONNECT: 'CmdOrCtrl+Shift+D',
SAVE: 'CmdOrCtrl+S',
RUN: 'CmdOrCtrl+R',
RUN_SELECTION: 'CmdOrCtrl+Alt+R',
RUN_SELECTION_WL: 'CmdOrCtrl+Alt+S',
STOP: 'CmdOrCtrl+H',
RESET: 'CmdOrCtrl+Shift+R',
NEW: 'CmdOrCtrl+N',
SAVE: 'CmdOrCtrl+S',
CLEAR_TERMINAL: 'CmdOrCtrl+L',
EDITOR_VIEW: 'CmdOrCtrl+Alt+1',
FILES_VIEW: 'CmdOrCtrl+Alt+2'
}
},
// Shortcuts
}

function disableShortcuts (win, value) {
console.log(value ? 'disabling' : 'enabling', 'shortcuts')
win.send('ignore-shortcuts', value)
}

module.exports = {
shortcuts,
disableShortcuts
}

25 changes: 4 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const { app, BrowserWindow, ipcMain, dialog, globalShortcut } = require('electron')
const path = require('path')
const fs = require('fs')
const shortcuts = require('./backend/shortcuts.js').global

const registerIPCHandlers = require('./backend/ipc.js')
const registerMenu = require('./backend/menu.js')

Expand All @@ -14,8 +12,8 @@ let splashTimestamp = null
function createWindow () {
// Create the browser window.
win = new BrowserWindow({
width: 720,
height: 640,
width: 820,
height: 700,
webPreferences: {
nodeIntegration: false,
webSecurity: true,
Expand Down Expand Up @@ -63,28 +61,13 @@ function createWindow () {
})
}

function shortcutAction(key) {
win.webContents.send('shortcut-cmd', key);
}

// Shortcuts
function registerShortcuts() {
Object.entries(shortcuts).forEach(([command, shortcut]) => {
globalShortcut.register(shortcut, () => {
shortcutAction(shortcut)
});
})
}

app.on('ready', () => {
createWindow()
registerShortcuts()

win.on('focus', () => {
registerShortcuts()
})

win.on('blur', () => {
globalShortcut.unregisterAll()
})

})
})
Loading