Skip to content

Commit

Permalink
Try out icons in history for a few common actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Inwerpsel committed Oct 19, 2024
1 parent b9677c0 commit 18ccb29
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 38 deletions.
64 changes: 32 additions & 32 deletions docs/demo/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/demo/dist/bundle.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/demo/dist/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/demo/dist/main.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/_unstable/historyStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function restoreHistory() {
};
}

let firstEntry = Infinity;
export let firstEntry = Infinity;

// problem:
// - If an action was done against a locked state, we need to keep track of this base index
Expand Down Expand Up @@ -89,7 +89,7 @@ export function deleteStoredHistory(createSnap = false, lastState = null) {
const snap = JSON.stringify([...lastState.entries()].filter(([k]) => interestingKeys.includes(k)));
localStorage.setItem(snapshotKey, snap);
}
didUrl = false;
firstEntry = Infinity;

console.log('Start store delete transaction in ', performance.now( ) - start)
}
8 changes: 6 additions & 2 deletions src/previewComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function FindOther({label}) {
</Fragment>
}

function Icon({children}) {
return <span style={{fontSize: '1.5rem'}}>{children}</span>
}

export const previewComponents = {
openGroups: ({ action: groups }) => {
const items = Object.keys(groups);
Expand Down Expand Up @@ -70,8 +74,8 @@ export const previewComponents = {

return (
<Fragment>
<Icon>🔍</Icon>
<ScrollInViewButton {...{path}} />
Inspect
<pre className="monospace-code">{group?.label}</pre>
{showLink && link}
</Fragment>
Expand All @@ -83,7 +87,7 @@ export const previewComponents = {

return (
<Fragment>
{scope && <pre className="monospace-code">{scope}</pre>}
<Icon>🖌</Icon>{scope && <pre className="monospace-code">{scope}</pre>}
<br />
<b draggable onDragStart={dragValue(`var(${name})`)}><FormatVariableName {...{name}}/></b> <br />
<span draggable onDragStart={dragValue(value)}>
Expand Down

0 comments on commit 18ccb29

Please sign in to comment.