-
Notifications
You must be signed in to change notification settings - Fork 8
chore: simplify running with different thv binary #1206
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
Open
kantord
wants to merge
29
commits into
main
Choose a base branch
from
simplify-running-with-local-binary
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
61f799f
chore: simplify running with different thv binary
kantord bfd0fa1
.
kantord 48a38a4
Merge branch 'main' into simplify-running-with-local-binary
kantord 552ad39
.
kantord 558b36f
.
kantord 9013693
.
kantord bb239a6
.
kantord 6a32df5
.
kantord 26bc5b5
.
kantord 228c3cd
.
kantord 2181beb
.
kantord 3ec3295
.
kantord 20ec7c4
.
kantord 6988c87
.
kantord 06b911b
Merge branch 'main' into simplify-running-with-local-binary
kantord 6e697ba
.
kantord 9f8dc9c
.
kantord d3e239c
Merge branch 'main' into simplify-running-with-local-binary
kantord ff15c63
.
kantord 4d17bd7
Merge branch 'main' into simplify-running-with-local-binary
kantord 5100b21
.
kantord 0f8f6ce
Merge branch 'main' into simplify-running-with-local-binary
kantord 53025ac
.
kantord cbeef64
.
kantord 31750d2
.
kantord 1e8113e
.
kantord a670f00
.
kantord bb2096c
.
kantord 14ab755
.
kantord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { useEffect, useState } from 'react' | ||
| import { AlertTriangle } from 'lucide-react' | ||
| import { Alert, AlertDescription } from './ui/alert' | ||
|
|
||
| /** | ||
| * Banner that displays a warning when using a custom ToolHive port in development mode. | ||
| * Only visible when THV_PORT environment variable is set. | ||
| */ | ||
| export function CustomPortBanner() { | ||
| const [isCustomPort, setIsCustomPort] = useState(false) | ||
| const [port, setPort] = useState<number | undefined>(undefined) | ||
|
|
||
| useEffect(() => { | ||
| Promise.all([ | ||
| window.electronAPI.isUsingCustomPort(), | ||
| window.electronAPI.getToolhivePort(), | ||
| ]) | ||
| .then(([usingCustom, toolhivePort]) => { | ||
| setIsCustomPort(usingCustom) | ||
| setPort(toolhivePort) | ||
| }) | ||
| .catch((error: unknown) => { | ||
| console.error('Failed to get custom port info:', error) | ||
| }) | ||
| }, []) | ||
|
|
||
| // Don't render if not using custom port or port is not available | ||
| if (!isCustomPort || !port) { | ||
| return null | ||
| } | ||
|
|
||
| const httpAddress = `http://127.0.0.1:${port}` | ||
|
|
||
| return ( | ||
| <Alert | ||
| variant="warning" | ||
| className="fixed bottom-4 left-1/2 z-50 w-auto max-w-[95vw] | ||
| -translate-x-1/2" | ||
| > | ||
| <AlertTriangle /> | ||
| <AlertDescription className="flex items-start gap-2"> | ||
| <div className="whitespace-nowrap"> | ||
| <span>Using external ToolHive at </span> | ||
| <span | ||
| className="rounded bg-yellow-100 px-1 py-0.5 font-mono text-xs | ||
| dark:bg-yellow-900" | ||
| title={httpAddress} | ||
| > | ||
| {httpAddress} | ||
| </span> | ||
| </div> | ||
| </AlertDescription> | ||
| </Alert> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ const alertVariants = cva( | |
| default: 'bg-card text-card-foreground', | ||
| destructive: | ||
| 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90', | ||
| warning: | ||
|
Member
Author
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. remove warning style from here and instead override in the component itself (because the warning is not an official design) |
||
| 'border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100', | ||
| }, | ||
| }, | ||
| defaultVariants: { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
use log instead of console.log