-
-
Notifications
You must be signed in to change notification settings - Fork 147
feat(devtools): extract theme to devtool components #366
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@tanstack/ai-devtools-core': patch | ||
| --- | ||
|
|
||
| Moves devtools theme to the component to avoid theme miss-match. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,15 +1,24 @@ | ||||||||||||||||||||||||||
| import { createSignal, onCleanup, onMount } from 'solid-js' | ||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||
| createSignal, | ||||||||||||||||||||||||||
| onCleanup, | ||||||||||||||||||||||||||
| onMount, | ||||||||||||||||||||||||||
| ThemeContextProvider, | ||||||||||||||||||||||||||
| } from 'solid-js' | ||||||||||||||||||||||||||
|
Comment on lines
+1
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix import member ordering to clear lint failure.
Proposed fix import {
+ ThemeContextProvider,
createSignal,
onCleanup,
onMount,
- ThemeContextProvider,
} from 'solid-js'📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 5-5: Member 'ThemeContextProvider' of the import declaration should be sorted alphabetically. (sort-imports) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| import { Header, HeaderLogo, MainPanel } from '@tanstack/devtools-ui' | ||||||||||||||||||||||||||
|
Comment on lines
+5
to
7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate all uses/imports of ThemeContextProvider
rg -n -C3 '\bThemeContextProvider\b' packages
# Locate exports/definitions to confirm owning module
rg -n -C3 'export .*ThemeContextProvider|const ThemeContextProvider|function ThemeContextProvider' packagesRepository: TanStack/ai Length of output: 1548 🏁 Script executed: # Check what's exported from `@tanstack/devtools-ui` package
rg -n 'export.*ThemeContextProvider|export.*from.*theme' packages/typescript/ai-devtools -A2 -B2
# Check the actual devtools-ui index or main export files
fd -e ts -e tsx -e js packages/typescript/ai-devtools/node_modules/@tanstack/devtools-ui 2>/dev/null | head -20
# Try to find the devtools-ui package.json or exports
find packages -name 'package.json' -path '*devtools-ui*' 2>/dev/nullRepository: TanStack/ai Length of output: 37 🌐 Web query:
💡 Result:
// theme-context.ts
import { createContext, useContext, type ParentComponent } from "solid-js";
type ThemeCtx = { theme: () => "light" | "dark"; setTheme: (t: "light" | "dark") => void };
const ThemeContext = createContext<ThemeCtx>();
export const ThemeProvider: ParentComponent<{ value: ThemeCtx }> = (props) => (
<ThemeContext.Provider value={props.value}>
{props.children}
</ThemeContext.Provider>
);
export const useTheme = () => useContext(ThemeContext);If what you want is a ready-made “export both provider + hook” helper, Citations:
Remove
🧰 Tools🪛 ESLint[error] 5-5: Member 'ThemeContextProvider' of the import declaration should be sorted alphabetically. (sort-imports) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| import { useStyles } from '../styles/use-styles' | ||||||||||||||||||||||||||
| import { AIProvider } from '../store/ai-context' | ||||||||||||||||||||||||||
| import { ConversationsList } from './ConversationsList' | ||||||||||||||||||||||||||
| import { ConversationDetails } from './ConversationDetails' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export default function Devtools() { | ||||||||||||||||||||||||||
| import type { DevtoolProps } from '@tanstack/devtools-utils/solid' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export default function Devtools(props: DevtoolProps) { | ||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||
| <AIProvider> | ||||||||||||||||||||||||||
| <DevtoolsContent /> | ||||||||||||||||||||||||||
| </AIProvider> | ||||||||||||||||||||||||||
| <ThemeContextProvider theme={props.theme}> | ||||||||||||||||||||||||||
| <AIProvider> | ||||||||||||||||||||||||||
| <DevtoolsContent /> | ||||||||||||||||||||||||||
| </AIProvider> | ||||||||||||||||||||||||||
| </ThemeContextProvider> | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: "miss-match" should be "mismatch".
The word should be "mismatch" (one word, no hyphen).
📝 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents