profile
viewpoint
Fabio Spampinato fabiospampinato @notable London, UK fabiospampinato.com Full-stack developer passionate about open source and empowering people.

fabiospampinato/autogit 460

Define commands, using plugins, to execute across all your repositories.

fabiospampinato/atomically 19

Write files atomically and reliably.

fabiospampinato/alfred-spaces-workflow 15

Alfred workflow that, used in conjunction with my Phoenix setup, gives you a spaces switcher.

fabiospampinato/alfred-eject-workflow 7

Alfred workflow for ejecting mounted drives.

cheatsheet-md/website 3

Cheatsheet.md's website.

fabiospampinato/airmash-swam-extensions 3

My AirMash extensions for SWAM.

fabiospampinato/autogit-command-github-publish 3

A command for publishing repositores to GitHub.

fabiospampinato/autogit-command-github-sync 3

A command for synchronizing repositories with GitHub.

fabiospampinato/ajv-filter 2

Library that enables ajv to filter objects, other than just validating them.

fabiospampinato/alfred-brush-workflow 1

Alfred workflow for reminding you to brush your teeth.

issue commentelectron/electron

macOS Mojave: Unclickable region in windows with "hiddenInset" title bar

Hm, I pulled those numbers from what I assume is a reliable source 🤔 Where did you get x=12 from?

Trial and error when comparing before and after screenshots. Where does that other coordinate come from?

javan

comment created time in 11 hours

issue closednotable/dumper

Error report: Cannot read property 'source-url' of undefined

  • OS Version: linux 5.3.0-40-generic
  • Notable Version: v1.8.4

I got this error while trying to import an evernote .enex file.

TypeError: Cannot read property 'source-url' of undefined
    at EnexNote.getMetadata (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:185842)
    at async EnexNote.get (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3578)
    at async EnexProvider.dump (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3469)
    at async Object.dump (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:201681)
    at async import_Import.import (file:///snap/notable/1/resources/app.asar/renderer/renderer.js:2:24287)

closed time in 12 hours

mssalvatore

issue commentnotable/dumper

Error report: Cannot read property 'source-url' of undefined

Duplicate of https://github.com/notable/dumper/issues/29

mssalvatore

comment created time in 12 hours

issue commentelectron/electron

macOS Mojave: Unclickable region in windows with "hiddenInset" title bar

@MarshallOfSound that seems to work perfectly for me, thanks!

Are there any drawbacks in removing the titlebar this way over via setting "hiddenInset"? If there aren't shouldn't Electron just execute the code you provided when the "hiddenInset" value is set?

P.S. The precise coordinates at which the traffic lights get positioned with "hiddenInset" seems to be { x: 12, y: 22 } on my system.

javan

comment created time in 12 hours

issue openednotable/notable

Add an "Edit -> Selection" menu

Something similar to what vscode provides:

image

created time in 13 hours

issue commentelectron/electron

macOS Mojave: Unclickable region in windows with "hiddenInset" title bar

Could this issue be prioritized higher please? @codebytere @MarshallOfSound

Attempting to work around this issue by setting the title to an empty string has all sorts of weird consequences:

  • Still a small area of the windows will be unresponsive to clicks.
  • Windows with empty titles won't be listed in the list of windows under the "Windows" app menu or in the app's menu from the Dock.
  • Switching between windows via App Exposé can be difficult if all windows look the same and you have no title to help you distinguish them.

And using a titlebar can really hinder the user experience for some apps, as they would look more like a website wrapped in an Electron shell with a quick script rather than something that's supposed to integrate much better with the OS.

javan

comment created time in 19 hours

issue closednotable/notable

Unordered lists break task check marks in preview mode

  • OS Version: macOS 10.15.5
  • Notable Version: 1.8.4

Current behavior

Create an unordered list with a task, followed by a task, i.e.:

* - [ ] foo
- [ ] bar

Switch back to preview mode.

Here's how it looks before attempting to check either of the tasks:

image

Clicking the second task ("bar") does nothing. Clicking the first task ("foo") actually checks the second box. Here's how it looks after that:

Rendered:

image

Markdown:

image

Expected behavior

Clicking a task check box should change the corresponding task's state by checking the box in preview mode and adding an x between it's opening and closing brackets.

closed time in a day

JoshCooley

issue commentnotable/notable

Unordered lists break task check marks in preview mode

I just fixed this, the fix will be available in the next release.

JoshCooley

comment created time in a day

issue commentnotable/notable

Unordered lists break task check marks in preview mode

This stems from my ignorance that this should actually works: * - [ ] foo, github handles it fine so should Notable, thanks for reporting the issue 👍

JoshCooley

comment created time in a day

issue openednotable/notable

Style checkmarks

created time in a day

issue commentnotable/notable

Tabs

You can get it now: https://github.com/notable/notable-experimental/releases/tag/v1.9.0-alpha.16

We are getting closer to the final release but we are not there yet.

funkrusher

comment created time in 2 days

issue commentnotable/notable

Support tasks in tables

@eugenefischer what are you using currently?

fabiospampinato

comment created time in 2 days

issue commentnotable/notable

Plantuml does not render Latex

This does seem to work in the official PlantUML renderer too (link).

The red guy in the diagram is how I feel 🤔

erex

comment created time in 2 days

pull request commentfabiospampinato/cash

Extend utility methods

No worries. And Notable looks awesome - about to play with it :-)

In that case I'd go straight to the v1.9 alphas (they are quite stable at this point, and although it may not look like it pretty much everything changed, v1.9 is like a different app that sort of looks like the old one): https://github.com/notable/notable-experimental/releases

DataTables

comment created time in 2 days

created tagnotable/notable-experimental

tagv1.9.0-alpha.16

A repository containing experimental releases of Notable.

created time in 2 days

release notable/notable-experimental

v1.9.0-alpha.16

released time in 2 days

push eventfabiospampinato/shortcuts

Fabio Spampinato

commit sha 6ddade3ac3aa0fe53af342ad99c7a0dc91d88d9a

Ensuring modifiers-only shortcuts aren’t handled if other keys got pressed on keydown

view details

Fabio Spampinato

commit sha e4ff5a54c9d965cbc93b80437d6416bddd75a0e7

Bumped version to 1.6.1

view details

push time in 2 days

push eventfabiospampinato/shortcuts

Fabio Spampinato

commit sha 3be7f89a73b1954fae833a99e7884a4f529817ce

Added support for shortcuts containing only modifiers

view details

Fabio Spampinato

commit sha e4c02ac1359a9910dab1acf6738b83b3bd10303b

Bumped version to 1.6.0

view details

push time in 2 days

pull request commentfabiospampinato/cash

Extend utility methods

Sorry about the delay in getting back to this, right now my priority is releasing v1.9 final of the app I'm working on, that's possible at least more than 10 days away, but I'll get back to this once the first beta is published, which should take roughly 7 days or less (assuming no particular setbacks).

DataTables

comment created time in 2 days

issue openednotable/notable

Improve shortcuts using PageUp or PageDown

They should actually lead to a page scroll, may of the current shortcuts instead just go to the previous or next item in a list.

created time in 2 days

issue commenttimburgan/timburgan

chess|move|b1c2|267

Oh no!

fabiospampinato

comment created time in 3 days

issue openedtimburgan/timburgan

chess|move|b1c2|267

Just push 'Submit new issue'. You don't need to do anything else.

created time in 3 days

startedtimburgan/timburgan

started time in 3 days

issue commenttimburgan/timburgan

Make the "New Game" button really obvious.

I think this should be wired with Stockfish and when Stockfish detects an advantage of +8 or more for either player the game will be automatically ended by that player 😂

timburgan

comment created time in 3 days

issue closednotable/notable

Movable folders, files, tags and notes

Features

  • Ability to move by mouse or keyboard alt+up/down
  • Ability to drag and drop certain child to another main folder or tag

Isn't it possible to edit certain note tag? but above features may save our time

image

closed time in 3 days

mHatsune

issue commentnotable/notable

Movable folders, files, tags and notes

The drag&drop part of this is tracked here: #15

The keyboard part of this I don't think it's necessary 🤔 as in order to implement it we would need to require to user to think about where the focus is all the time, and that introduces unnecessary complications IMHO.

mHatsune

comment created time in 3 days

issue commentnotable/notable

Customizable default link format when pasting an attachment

Currently this breaks every other markdown editor because they can't understand @attachment

I'll add an option, but I don't think this makes the app less "no vendor lock-in", like the "standard" way to link to things is still supported

gagarcr

comment created time in 3 days

issue openednotable/notable

Reduce dependencies further

  • [ ] ajv: it's the wrong tool for the job, it's relatively heavy and most importantly adds too much time at startup.
    • Maybe something like yup could be used.
  • [ ] chokidar: it has some relatively heavy glob-related dependencies and it's size could be cut in half by removing them (https://github.com/paulmillr/chokidar/issues/1016)
  • [ ] lodash: we don't need all of lodash, so at least probably a partial bundle should be made, however lodash partial bundles aren't particularly good, maybe we should just rewrite the few things we need.
  • [ ] context-keys: the parser is quite large, maybe we should make a smaller one trading in some performance
  • [ ] react-window: it provides some components and features we don't need (yet?)

created time in 4 days

issue commentnotable/notable

Provide a proper "licenses" document

Ref: https://github.com/mongodb-js/electron-license

fabiospampinato

comment created time in 4 days

issue openednotable/notable

Support toggling the "Visible on all workspaces" state

  • Ref: https://www.electronjs.org/docs/all#winsetvisibleonallworkspacesvisible
  • Bug: https://github.com/electron/electron/issues/24448

created time in 4 days

issue openednotable/notable

Provide menu items to Unity launcher

Ref: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher

created time in 4 days

issue openednotable/notable

Support global shortcuts

Ref: https://www.electronjs.org/docs/all#globalshortcut

created time in 4 days

issue openednotable/notable

Provide menu items for macOS' dock

Ref: https://www.electronjs.org/docs/all#docksetmenumenu-macos

created time in 4 days

issue openednotable/notable

Provide recent documents to the OS

Ref: https://www.electronjs.org/docs/all#recent-documents-windows--macos

Should we list notes or data directories? 🤔

created time in 4 days

issue openednotable/notable

Automatic dark theme switching

Ref: https://www.electronjs.org/docs/all#automatically-updating-your-own-interfaces

created time in 4 days

issue openednotable/notable

attachment.copyFile command

This doesn't seem implementable in general just yet.

created time in 4 days

issue openednotable/notable

attachment.copyImage command

created time in 4 days

issue commentnotable/notable

Show progress bar while exporting

  • Badges could be used for this: https://www.electronjs.org/docs/all#docksetbadgetext-macos
    • Windoes: https://github.com/viktor-shmigol/electron-windows-badge/blob/master/index.js
  • Statusbar items can also be used for this
fabiospampinato

comment created time in 4 days

issue openednotable/notable

Request user attention when an action is required

Action required:

  • Notification (maybe)
  • Dialog

Ways to request attention:

  • Flashing: https://www.electronjs.org/docs/all#winflashframeflag (which makes the dock icon bounce on macOS too)

created time in 4 days

issue openednotable/notable

Provide badges for macOS

Ref: https://www.electronjs.org/docs/all#appsetbadgecountcount-linux-macos

created time in 4 days

issue openednotable/notable

Provide tasks for Windows

Ref: https://www.electronjs.org/docs/all#appsetusertaskstasks-windows

created time in 4 days

issue openednotable/notable

Support recording the window

Ref: https://www.electronjs.org/docs/api/desktop-capturer

created time in 4 days

issue openednotable/notable

Quicklook support

Ref: https://www.electronjs.org/docs/all#winpreviewfilepath-displayname-macos

created time in 4 days

issue openednotable/notable

Dynamic debounce length

Some operations throughout the app are debounced with a fixed interval, the interval instead should depend on how long it took for the previous operation to complete.

created time in 4 days

issue openednotable/notable

Autosaving notes

If an editor is being used for hours continuously and the power is cut off or something there could be some data loss. Notes should probably be auto-saved.

created time in 4 days

issue openednotable/notable

Render a specific page of a pdf

created time in 4 days

issue openednotable/notable

New editor commands

  • [ ] duplicate current line
  • [ ] duplicate selection
  • [ ] join/sort/transform lines (linesOperations module)
  • [ ] Look at other supported commands that we aren't exposing yet because there didn't have a shortcut assigned to them by default

created time in 4 days

issue openednotable/notable

New context key: isCursorAtHeading

created time in 4 days

issue openednotable/notable

Read-only editor tooltip

created time in 4 days

issue openednotable/notable

Configurable tab close button behavior

  • [ ] Always shown
  • [ ] On hover
  • [ ] Never

created time in 4 days

issue openednotable/notable

Expose preferred Markdown symbols options

Like which character should be used in lists.

created time in 4 days

issue openednotable/notable

Expose markdown-it "break" option

In order to better support people who break their lines at arbitrary lengths but don't want a newline to be inserted in that case.

created time in 4 days

issue openednotable/notable

Expose TOC options

  • max depth
  • enumeration
  • max enumeration depth

created time in 4 days

issue openednotable/notable

Website news section

Some kind of "news" section should be added to the website, perhaps by embedding tweets from @TheNotableApp.

created time in 4 days

issue openednotable/notable

Map "Alt" to "view.menubar.toggle"

That's the expected behavior under windows and linux.

created time in 4 days

issue openednotable/notable

Refine resizing logic for resizable columns

The columns should be more fixed and less dynamic when resizing the app, more like how it works in macOS.

created time in 4 days

issue openednotable/notable

Persistent tags

Persistent tags would be remembered and would be shown even if they contain no notes.

Toggling the persistence state would work kind of like in tabs.

created time in 4 days

issue commentnotable/notable

Search links do not change cursor focus

I'm not sure we should switch focus to the search bar by default 🤔

MMK21Hub

comment created time in 4 days

issue commentelectron-userland/electron-builder

Remove "lodash.isEqual" dependency

Jesus, I hate this.

fabiospampinato

comment created time in 4 days

created tagnotable/notable-experimental

tagv1.9.0-alpha.15

A repository containing experimental releases of Notable.

created time in 4 days

release notable/notable-experimental

v1.9.0-alpha.15

released time in 4 days

issue openedelectron/electron

Missing "visible-on-all-workspaces-changed" event

Problem Description

The internal state that apps keep of whether each window is visible on all workspaces or not can't be kept in sync with the actual state of the window (assuming polling is not acceptable) because there currently doesn't seem to be a way to detect with the "visibleOnAllWorkspaces" property changes from outside the app, e.g. like by manually toggling this on macOS' dock.

Proposed Solution

There should be a "visible-on-all-workspaces-changed" event, like there is a "always-on-top-changed" event.

Alternatives Considered

Polling? But it's unclear whether the BrowserWindow#visibleOnAllWorkspaces is even kept synchronized with external changes and polling would be unreasonable for this.

created time in 5 days

issue openedelectron/electron

"devtools-reload-page" can't be prevented

Issue Details

  • Electron Version:
    • 9.1.0
  • Operating System:
    • macOS 10.14
  • Last Known Working Electron version:
    • N/A

Expected Behavior

Calling preventDefault on "devtools-reload-page" event should prevent that event from happening, otherwise I'm not sure what the usefulness of this event is.

Actual Behavior

It can't be prevented

To Reproduce

Gist: https://gist.github.com/7a6827ccc6b30488118d71c3ea4299e2

Just reload the window from the devtools and notice how the timestamp written in the DOM changes because the page reloaded anyway.

created time in 5 days

issue openedelectron/electron

Distinguish hard and soft reload from the "devtools-reload-page" event

Problem Description

It should be possible to understand if the user wanted a soft an hard reload from the "devtools-reload-page" event, so that it can be hijacked and the correct kind of reload can be then reemitted.

Proposed Solution

Either adding a property for this to the emitted event, or adding a "devtools-hard-reload-page" event, but the latter would be a backwards incompatible change as it would make sense to emit both events.

Alternatives Considered

I'm not sure this can be done in other ways, maybe one can inject some custom shortcuts detection logic into the devtools webview but that'd be crazy.

created time in 5 days

push eventnotable/notable-customizations

RyanGreenup

commit sha da258ac8c1dec35c47677a10589d2cba379d48c2

Added a Script to Print Backlinks + recoll Search (#4)

view details

push time in 5 days

PR merged notable/notable-customizations

Added a Script to Print Backlinks + recoll Search
  • A Script to Print Backlinks
  • A way to search through notes using Recoll from Something like Emacs/VSCode/Vim (Good if you don't want to leave your text editor.
  • Made Extra Heading for Clarity.
+9 -3

1 comment

1 changed file

RyanGreenup

pr closed time in 5 days

issue commentelectron/electron

Calling hang() or crash() in browser window does not trigger unresponsive or crashed events

@codebytere that kind of works, but I have to wait for like 2 minutes and 30 seconds for the "unresponsive" event to be triggered, that sounds too high a timeout to me, if things are unresponsive for 2 minutes straight I might just cut the power out 😅 is there any way to customize this?

jocodev1

comment created time in 5 days

pull request commentnotable/notable-customizations

Added a Script to Print Backlinks + recoll Search

Can you put the links under Other customizations instead? Otherwise every script could have it's own level-2 heading and the document would become harder to browse, potentially could introduce sections inside "Other Customizations" too at some point.

RyanGreenup

comment created time in 5 days

issue commentelectron/electron

It takes multiple seconds for the first `localStorage.getItem` call

I think this is probably a duplicate of #22438, as I can reproduce how having only one instance open of the app makes this issue disappear

fabiospampinato

comment created time in 5 days

issue commentelectron/electron

It takes multiple seconds for the first `localStorage.getItem` call

I've just measured some times and it actually takes about ~3750ms for that call alone on my machine, and like 50% of the times the number is within 5~10ms of that, almost like if there was a timeout of 3700ms somewhere or something.

fabiospampinato

comment created time in 5 days

issue commentelectron/electron

It takes multiple seconds for the first `localStorage.getItem` call

One of my users who can also experience this issue has a ~650kb app data folder, even loading all that from spinning rust shouldn't take that 5 seconds I think.

fabiospampinato

comment created time in 5 days

issue openedelectron/electron

It takes multiple seconds for the first `localStorage.getItem` call

Issue Details

  • Electron Version:
    • 9.1.0
  • Operating System:
    • macOS 10.14
  • Last Known Working Electron version:
    • Maybe Electron <= v7, although maybe I wasn't using localStorage at all back then 🤔

Expected Behavior

LocalStorage shouldn't be absurdly slow.

Actual Behavior

LocalStorage is absurdly slow, requiring about 5 seconds on my machine for this call:

localStorage.getItem('');

To Reproduce

This is a weird one, I spent a couple of hours tracking down this one, you might be able to reproduce it with the files provided but I'm not sure.

  1. Running npx electron app_dummy_slow.asar requires about 5 seconds on my machine for a window to show up.
  2. No need really to unpack the asar, it's essentially the quick-start project with only 2 interesting lines, without either of which I can't reproduce the issue:
    1. localStorage.getItem('');
      • Putting this call somewhere in index.html takes about 5 seconds to complete, which sounds absurd to me. Without this call I can't experience any issues.
      • The same thing happens when using sessionStorage.
    2. "name": "notable",
      • This is in the package.json file, using a different name I can't reproduce the issue. As "notable" is the name of my Electron app I guess when setting this name its specific local storage and session storage files are getting loaded, which for whatever reason takes forever.
  3. The "Local Storage" and "Session Storage" folders, attached below, found under "~/Library/Application Support/Notable", weigh like less than 50kb each, making this even weirder.
  4. Somewhat surprisingly Notable's appData folder weighs about 20MB on my machine, while the analogous folders for other electron apps on my machine weigh about 500kb each, but its content seems ok to me:

image

Resources

app_dummy_slow.asar.zip Session Storage.zip Local Storage.zip

created time in 5 days

issue commentelectron/electron

Calling hang() or crash() in browser window does not trigger unresponsive or crashed events

I can reproduce in v9.1.0 that the unresponsive event is never fired when calling process.hang.

renderer-process-crashed is fired for me though.

jocodev1

comment created time in 5 days

issue openedelectron/electron

"will-attach-webview" is never triggered

<!-- As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can. -->

Preflight Checklist

<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

  • [ ] I have read the Contributing Guidelines for this project.
  • [ ] I agree to follow the Code of Conduct that this project adheres to.
  • [ ] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 9.0.5
  • Operating System:
    • macOS 10.14
  • Last Known Working Electron version:
    • N/A

Expected Behavior

"will-attach-webview" should be triggered.

Actual Behavior

It's not triggered, making it impossible to implement one the suggested steps for securing electron apps.

To Reproduce

Gist: https://gist.github.com/d1c69ddc270ffd9902b48150bc5fec2a

created time in 5 days

issue commentelectron/electron

mouseover in main window disabled while contextmenu showing

@xthdraft Thanks for the suggestion. The "simply" part of that I'm not too sure about, as you have a edge cases related to your menus being constrained by the window's bounds. Besides Electron apps should behave more native-like when possible, and using those native menus that can go beyond the bounds of your window has a nice feeling to it:

Screen Recording 2020-07-07 at 00 52 51

xthdraft

comment created time in 5 days

issue commentelectron-userland/electron-builder

Remove "js-yaml" dependency

@develar Is this stupid bot really useful to you? I find it pretty frustrating to deal with it.

fabiospampinato

comment created time in 6 days

issue commentfabiospampinato/khroma

allow object oriented usage

Maybe a nice quick way to fix this would be to add a "clone" method to the "Channels" class. However you could potentially already clone Channel classes already manually.

jquense

comment created time in 6 days

issue commentfabiospampinato/khroma

allow object oriented usage

Sure, I could add a way to output non-reused Channels instances, although this is a bit of an implementation detail and I'd prefer not to expose it if possible, why do you need this? Is this purely for performance reasons?

jquense

comment created time in 6 days

issue closednotable/notable

Ability to edit images size

Current Behavior

Only allow to add as attachments and no previews

Expected Behavior

Display preview by default and let users to change size, movable around note page however original image necessary to remain in note folder

closed time in 6 days

mHatsune

issue commentnotable/notable

Ability to edit images size

I'd consider this part of the WYSIWYG then #284

mHatsune

comment created time in 6 days

issue commentelectron/electron

mouseover in main window disabled while contextmenu showing

It would be useful to have the ability to still receive mouse events while context menus are open, in order to implement a note-like menubar experience under Windows for example where context menus are opened and closed depending on where the cursor is.

xthdraft

comment created time in 6 days

push eventfabiospampinato/atomically

Fabio Spampinato

commit sha ec797b2589205271bf1f6b5e252bdfacc50bca74

Generating random hex characters without using the “crypto” module, reducing startup performance by about 40%

view details

Fabio Spampinato

commit sha ca34368ec2ed96f35b96c7da8b1492544aab6418

Bumped version to 1.3.1

view details

Fabio Spampinato

commit sha 55d056fcc42633588ed329337108b101cce4e9da

Ensuring the test suite is being run before publishing to NPM

view details

push time in 7 days

issue commentelectron/electron

Document how to make a custom title bar on macOS respect native double-click behavior

For future readers: the function mentioned in this thread that is supposed to handle this correctly is not handling the case where the double click action on titlebars is disabled entirely in system preferences, the proper function for handling this should look more like this:

const handleDoubleClick = () => {
  const win = remote.getCurrentWindow();
  if ( !win ) return; // No window, nothing to do, although this check doesn't make a whole lot of sense from the renderer process, but you shouldn't handle this from the renderer process
  if ( process.platform === 'darwin' ) { // `getUserDefault` is only available under macOS
    const action = remote.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string');
    if ( action === 'None' ) return; // Action disabled entirely, nothing to do
    if ( action === 'Minimize') return win.minimize(); // The user prefers to minimize the window, weird
  }
  // Toggling maximization otherwise
  // Under macOS this should actually trigger the "zoom" action, but I believe that's identical to toggling maximization for Electron apps, so we'll just do that for simplicity here
  // In case you want to trigger the zoom action for some reason: Menu.sendActionToFirstResponder ( 'zoom:' );
  if (win.isMaximized()) return win.unmaximize();
  return win.maximize ();
}
sindresorhus

comment created time in 7 days

issue commentpaulmillr/chokidar

Use dirent instead of stats to improve performance 2x

FYI I've been using the following function for a while and yesterday I benchmarked it against fdir, after reading this issue, and this simple function is about twice as fast as fdir:

  readdirp: Tasker.wrap ( ( folderPath: string ): Promise<string[]> => {

    const normalizePath = Env.is.windows ? ( filePath: string ): string => filePath.replace ( /(?:\/|\\)+/g, '\\' ) : ( filePath: string ): string => filePath,
          files: string[] = [];

    const populateFiles = async ( folderPath: string ): Promise<string[]> => {

      const dirents = await fs.promises.readdir ( folderPath, { withFileTypes: true } ).catch ( error => console.error ( error ) ) || [];

      if ( !dirents.length ) return files;

      await Promise.all ( dirents.map ( ( dirent ): Promise<string[]> | undefined => {

        if ( SettingsStatic.junk.nameRe.test ( dirent.name ) ) return;

        const subPath = Path.resolve ( folderPath, dirent.name );

        if ( dirent.isDirectory () ) return populateFiles ( subPath );

        files.push ( normalizePath ( subPath ) );

      }));

      return files;

    };

    return populateFiles ( folderPath );

  })
paulmillr

comment created time in 7 days

startedwexond/desktop

started time in 7 days

issue commentelectron/electron

options --enable-transparent-visuals --disable-gpu seem to be unnecessary . Deprecate it ?

Is these options still required ?

My app doesn't render inside VMs without --disable-gpu, so I wouldn't remove it.

doom-fr

comment created time in 7 days

issue commentelectron/electron

Document how to make a custom title bar on macOS respect native double-click behavior

Good news, this is actually quite straight forward to implement (if you know the magic NSUserDefaults key).

There are a bunch of interesting that can be done with Electron if only ones knows these "magic" strings. It might be a good idea to document them somewhere in the docs.

sindresorhus

comment created time in 7 days

issue commentelectron/electron

Proposal for new module: shortcuts

Maybe it would be more appropriate and web-friendly to use a third-party library for this, like this one: https://github.com/fabiospampinato/shortcuts

Like what feature could Electron offer than third-party libraries can't offer too? And if this is implementable completely via third-party libraries why going for an Electron-only version which would be painful to move from once/if the app will also ever run in the browser.

poiru

comment created time in 7 days

issue commentelectron/electron

API to access localStorage in browser process

Echoing on what others have said: this would also be super useful for passing some data to new BrowserWindows in a way that's immediately available to them as soon as they start executing any code.

cuixiping

comment created time in 7 days

issue commentelectron/electron

TitleBar/MenuBar Settings

I don't think this is quite implementable for native titlebars, as it would depend on what each underlying UI framework can do, but you can do whatever you want already when reimplementing the titlebar yourself.

AutumnWohlen

comment created time in 7 days

issue commentelectron/electron

Printing crash the application

This is a duplicate of #20634, which provides reproducible steps too.

popod

comment created time in 7 days

issue commentelectron/electron

Bring in own user agent styles

Maybe adding a way to disable the built-in user agent stylesheet would be more appropriate.

NetOperatorWibby

comment created time in 7 days

issue commentelectron/electron

Cascading of windows

It sounds like a job for a third-party library. @chandrakalva What do you think the logic behind this should look like? I might take a shot at this at some point.

chandrakalva

comment created time in 7 days

issue commentelectron/electron

Electron and simulation accuracy

I think you might be talking about another kind of "electron" here 🤔 Electron is basically a browser, not a physics simulator.

Roger-Hlls

comment created time in 7 days

more