Coder Social home page Coder Social logo

Body pane filesystem : fix timing and transition to get rid of vscode errors in debug console when de-hoisting/changing documents. about leointeg HOT 8 CLOSED

boltex avatar boltex commented on July 19, 2024
Body pane filesystem : fix timing and transition to get rid of vscode errors in debug console when de-hoisting/changing documents.

from leointeg.

Comments (8)

boltex avatar boltex commented on July 19, 2024

Redo body pane file provider to be able to give out stats from any gnx in the leo document., as timing from vscode can be tricky if user expands notes or polls leo from some info to show parts of the tree that were refreshed from an earlier refresh call.

Might have to answer from other opened documents than the currently selected one, for example, if just switched from one document to the other.

from leointeg.

boltex avatar boltex commented on July 19, 2024

Note: The node' id could be a double murmurhash of the "ap" json string, https://github.com/garycourt/murmurhash-js, doubled means 64 bit instead of 32. this would maintain node identity and replace the decorated incremented number used as of now... see https://security.stackexchange.com/questions/209882/can-a-32-bit-hash-be-made-into-a-64-bit-hash-by-calling-it-twice-with-different/210049#210049

function hash64(str) {
var h1 = hash32(str); // returns 32 bit (as 8 byte hex string)
return h1 + hash32(h1 + str); // 64 bit (as 16 byte hex string)
}

from leointeg.

boltex avatar boltex commented on July 19, 2024

By using a double murmurhash of the "ap" json string, as id for outline nodes, and only refreshing them (by changing salt used with hash) when operations do actually change the tree (opposite of just navigating the tree) This will prevent refreshes and flashing/redraw.

from leointeg.

edreamleo avatar edreamleo commented on July 19, 2024

@boltex Never heard of a murmurhash until just now. Google enlightened me. The general idea seems good.

from leointeg.

boltex avatar boltex commented on July 19, 2024

Actually salt might be needed (see below)

Actually no need for 'Salt' at all: if the collaped state is part of the json data, the 64 (or whatever lenght) key will be different, thus refreshing the collapsed state if it changed.

from leointeg.

boltex avatar boltex commented on July 19, 2024

Important: When browsing tree without changing it (navigating) having hashes for IDs will allow to use only 'reveal' method without any 'refreshes' needed at all! This will greatly benefit navigation experience!

from leointeg.

boltex avatar boltex commented on July 19, 2024

Implementation Revision:
Salt is incremented with tree-changing operations , but stays the same when only navigating the tree. (up down, left right,..pgup/pgdn)

Salt is also needed, depending of navigation mode, when simply navigating the tree:

1- "Standard vscode" tree navigation mode

  • change salt when collapsing / expanding, to change collapsed-state and set selection
    (consider expand/collapse to be tree changing)

2- "Leo" tree navigation mode

  • dont change salt, just use reveal with the newly selected node as parameter.

from leointeg.

edreamleo avatar edreamleo commented on July 19, 2024

@boltex Imo, this issue does not affect leoserver.py. I have removed the comment in leoserver.py.

from leointeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.