diff --git a/remix/app/Providers/ThingtimeProvider.tsx b/remix/app/Providers/ThingtimeProvider.tsx
index ce16de3..b7c9307 100644
--- a/remix/app/Providers/ThingtimeProvider.tsx
+++ b/remix/app/Providers/ThingtimeProvider.tsx
@@ -1,5 +1,5 @@
import React, { createContext } from "react"
-import { parse, stringify } from "flatted"
+import flatted, { parse, stringify } from "flatted"
import { sanitise } from "~/functions/sanitise"
import { smarts } from "~/smarts"
@@ -17,14 +17,24 @@ export const ThingtimeContext = createContext<
try {
window.smarts = smarts
+ window.flatted = {
+ parse,
+ stringify,
+ }
} catch (err) {
// nothing
}
const force = {
settings: {
- // commanderActive: false,
- // hideSuggestionsOnToggle: true,
+ commanders: {
+ nav: {
+ // commanderActive: false,
+ // clearCommanderOnToggle: true,
+ // clearCommanderContextOnToggle: true,
+ // hideSuggestionsOnToggle: true,
+ },
+ },
},
version: 23,
}
@@ -41,10 +51,14 @@ const newVersionData = {
const initialValues = {
settings: {
- commanderActive: false,
- clearCommanderOnToggle: true,
- clearCommanderContextOnToggle: true,
- hideSuggestionsOnToggle: true,
+ commanders: {
+ nav: {
+ commanderActive: false,
+ clearCommanderOnToggle: true,
+ clearCommanderContextOnToggle: true,
+ hideSuggestionsOnToggle: true,
+ },
+ },
},
Content: {
hidden1: "Edit this to your heart's desire.",
@@ -220,6 +234,7 @@ export const ThingtimeProvider = (props: any): JSX.Element => {
if (thingtimeFromLocalStorage) {
const parsed = parse(thingtimeFromLocalStorage)
+ console.log("thingtime restored from localstorage", parsed)
if (parsed) {
const localIsValid =
!parsed.version || parsed.version >= force.version
@@ -230,10 +245,7 @@ export const ThingtimeProvider = (props: any): JSX.Element => {
const withVersionUpdates = smarts.merge(newVersionData, parsed)
newThingtime = smarts.merge(force, withVersionUpdates)
}
- console.log(
- "nik setting new thingtime from localStorage",
- newThingtime
- )
+ console.log("restoring thingtime from localStorage", newThingtime)
set(newThingtime)
}
} else {
diff --git a/remix/app/components/Commander/Commander.tsx b/remix/app/components/Commander/Commander.tsx
index 215c3bf..50b8407 100644
--- a/remix/app/components/Commander/Commander.tsx
+++ b/remix/app/components/Commander/Commander.tsx
@@ -14,6 +14,10 @@ export const Commander = (props) => {
const { thingtime, setThingtime, getThingtime, thingtimeRef, paths } =
useThingtime()
+ const commanderId = React.useMemo(() => {
+ return props?.id || "global"
+ }, [props?.id])
+
const inputRef = React.useRef()
const [inputValue, setInputValue] = React.useState("")
@@ -22,6 +26,10 @@ export const Commander = (props) => {
const [active, setActive] = React.useState(false)
const [contextPath, setContextPath] = React.useState()
+ const mode = React.useMemo(() => {
+ return props?.mode || "value"
+ }, [props?.mode])
+
const [showContext, setShowContextState] = React.useState(false)
const mobileVW = React.useMemo(() => {
@@ -45,8 +53,8 @@ export const Commander = (props) => {
}, [contextPath, getThingtime])
const commanderActive = React.useMemo(() => {
- return thingtime?.settings?.commanderActive
- }, [thingtime?.settings?.commanderActive])
+ return getThingtime("settings.commanderActive." + commanderId)
+ }, [commanderId, getThingtime])
// commanderActive useEffect
React.useEffect(() => {
diff --git a/remix/app/components/Icon/Icon.tsx b/remix/app/components/Icon/Icon.tsx
index 5fbc1b0..b49d85f 100644
--- a/remix/app/components/Icon/Icon.tsx
+++ b/remix/app/components/Icon/Icon.tsx
@@ -127,6 +127,19 @@ export const Icon = (props) => {
if (["thumb-down", "dislike"]?.includes(name)) {
return "👎"
}
+ if (["plus", "add"]?.includes(name)) {
+ return "➕"
+ }
+ if (["seedling", "seed"]?.includes(name)) {
+ return "🌱"
+ }
+ if (["undefined"]?.includes(name)) {
+ return "❓"
+ // return "🌫️"
+ }
+ if (["codex", "robot", "ai", "chatgpt"]?.includes(name)) {
+ return "🤖"
+ }
if (["thingtime"]?.includes(name)) {
if (Math.random() > 0.5) {
return "🌳"
diff --git a/remix/app/components/Nav/Nav.tsx b/remix/app/components/Nav/Nav.tsx
index d8ae81c..3266fae 100644
--- a/remix/app/components/Nav/Nav.tsx
+++ b/remix/app/components/Nav/Nav.tsx
@@ -49,7 +49,7 @@ export const Nav = (props) => {