-
Notifications
You must be signed in to change notification settings - Fork 0
chore: sync upstream dev #82
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
Changes from 7 commits
2039c90
d4ad650
ad82616
2df47ee
14f0bf6
4087cf1
e4bd975
d80e86b
d0a7ca6
19231fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| { | ||
| "nodeModules": { | ||
| "x86_64-linux": "sha256-AD5kt1o035hdvYPyrvjiz2mcsXFJ7UJVEmbE9AJFDFs=", | ||
| "aarch64-linux": "sha256-f1gVXUpIRWC/I8dxIigdGGvPsju04MXVjZhtq5EYL64=", | ||
| "aarch64-darwin": "sha256-c+JRpjs2gsgQ2czyM6bTbYEdMbX/erOSQdX6TdrI59k=", | ||
| "x86_64-darwin": "sha256-iB7l4PtQQ9Mx/XAdtyayiLe6pZKhuXB9lpmrbTr+uWc=" | ||
| "x86_64-linux": "sha256-SiJd6uXrL/MqqFGN/uUcHh0Wzdlafnpx++VZa5gUCoE=", | ||
| "aarch64-linux": "sha256-pKcT34NYIHVasraRTx0ASTzyuFuIzBTxXg6+KSKvTps=", | ||
| "aarch64-darwin": "sha256-hzrym0KpiyYAv80eT/DjcSIJWYBUq4QDgDf6Wtot7jU=", | ||
| "x86_64-darwin": "sha256-Or5dSTdajUwij0XpovXSXjJ0LmRUcpcW5TJ4q4B0k0A=" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ import { | |
| } from "solid-js" | ||
| import { createStore, produce } from "solid-js/store" | ||
| import { useParams } from "@solidjs/router" | ||
| import { Link } from "@/components/link" | ||
| import { ExternalLink } from "@/components/external-link" | ||
| import { useServerSDK } from "@/context/server-sdk" | ||
| import { useServerSync } from "@/context/server-sync" | ||
| import { useLanguage } from "@/context/language" | ||
|
|
@@ -836,12 +836,12 @@ function ProviderConnection(props: { | |
| <div>{language.t("provider.connect.opencodeZen.line2")}</div> | ||
| <div> | ||
| {language.t("provider.connect.opencodeZen.visit.prefix")} | ||
| <Link | ||
| <ExternalLink | ||
| href="https://opencode.ai/zen" | ||
| class="text-v2-text-text-base focus-visible:rounded-xs focus-visible:outline-2 focus-visible:outline-v2-border-border-focus" | ||
| > | ||
| {language.t("provider.connect.opencodeZen.visit.link")} | ||
| </Link> | ||
| </ExternalLink> | ||
| {language.t("provider.connect.opencodeZen.visit.suffix")} | ||
| </div> | ||
| </div> | ||
|
|
@@ -886,9 +886,9 @@ function ProviderConnection(props: { | |
| <div class="text-14-regular text-text-base">{language.t("provider.connect.opencodeZen.line2")}</div> | ||
| <div class="text-14-regular text-text-base"> | ||
| {language.t("provider.connect.opencodeZen.visit.prefix")} | ||
| <Link href="https://opencode.ai/zen" tabIndex={-1}> | ||
| <ExternalLink href="https://opencode.ai/zen" tabIndex={-1}> | ||
| {language.t("provider.connect.opencodeZen.visit.link")} | ||
| </Link> | ||
| </ExternalLink> | ||
| {language.t("provider.connect.opencodeZen.visit.suffix")} | ||
| </div> | ||
| </div> | ||
|
|
@@ -967,9 +967,9 @@ function ProviderConnection(props: { | |
| <div class="flex flex-col gap-5 px-3 text-[13px] font-[440] leading-5 tracking-[-0.04px] text-v2-text-text-muted"> | ||
| <div> | ||
| {language.t("provider.connect.oauth.code.visit.prefix")} | ||
| <Link href={store.authorization!.url} class="text-v2-text-text-base"> | ||
| <ExternalLink href={store.authorization!.url} class="text-v2-text-text-base"> | ||
| {language.t("provider.connect.oauth.code.visit.link")} | ||
| </Link> | ||
| </ExternalLink> | ||
| {language.t("provider.connect.oauth.code.visit.suffix", { provider: provider().name })} | ||
| </div> | ||
| <form onSubmit={handleSubmit} class="flex flex-col items-start gap-5 self-stretch"> | ||
|
|
@@ -1006,7 +1006,9 @@ function ProviderConnection(props: { | |
| <div class="flex flex-col gap-6"> | ||
| <div class="text-14-regular text-text-base"> | ||
| {language.t("provider.connect.oauth.code.visit.prefix")} | ||
| <Link href={store.authorization!.url}>{language.t("provider.connect.oauth.code.visit.link")}</Link> | ||
| <ExternalLink href={store.authorization!.url}> | ||
| {language.t("provider.connect.oauth.code.visit.link")} | ||
| </ExternalLink> | ||
| {language.t("provider.connect.oauth.code.visit.suffix", { provider: provider().name })} | ||
| </div> | ||
| <form onSubmit={handleSubmit} class="flex flex-col items-start gap-4"> | ||
|
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.
|
||
|
|
@@ -1077,7 +1079,9 @@ function ProviderConnection(props: { | |
| <div class="flex flex-col gap-6"> | ||
|
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.
|
||
| <div class="text-14-regular text-text-base"> | ||
|
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.
|
||
| {language.t("provider.connect.oauth.auto.visit.prefix")} | ||
| <Link href={store.authorization!.url}>{language.t("provider.connect.oauth.auto.visit.link")}</Link> | ||
| <ExternalLink href={store.authorization!.url}> | ||
|
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.
|
||
| {language.t("provider.connect.oauth.auto.visit.link")} | ||
| </ExternalLink> | ||
| {language.t("provider.connect.oauth.auto.visit.suffix", { provider: provider().name })} | ||
| </div> | ||
| <TextField | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { ComponentProps, splitProps } from "solid-js" | ||
|
|
||
| export interface ExternalLinkProps extends Omit<ComponentProps<"a">, "href"> { | ||
| href: string | ||
| } | ||
|
|
||
| export function ExternalLink(props: ExternalLinkProps) { | ||
| const [local, rest] = splitProps(props, ["href", "children", "class", "target", "rel"]) | ||
|
|
||
| return ( | ||
| <a | ||
| href={local.href} | ||
| class={`text-text-strong underline ${local.class ?? ""}`} | ||
|
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.
|
||
| target={local.target ?? "_blank"} | ||
| rel={local.rel ?? "noopener noreferrer"} | ||
| {...rest} | ||
| > | ||
| {local.children} | ||
| </a> | ||
| ) | ||
| } | ||
|
Comment on lines
+7
to
+21
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.
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { createStore, reconcile } from "solid-js/store" | ||
| import { type Accessor, batch, createEffect, createMemo, createRoot, getOwner, onCleanup } from "solid-js" | ||
| import { useParams, useSearchParams } from "@solidjs/router" | ||
| import { useNavigate, useParams, useSearchParams } from "@solidjs/router" | ||
| import { createSimpleContext } from "@opencode-ai/ui/context" | ||
| import type { ServerSDK } from "./server-sdk" | ||
| import type { ServerSync } from "./server-sync" | ||
|
|
@@ -118,6 +118,7 @@ export const { use: useNotification, provider: NotificationProvider } = createSi | |
| const global = useGlobal() | ||
| const server = useServer() | ||
| const tabs = useTabs() | ||
| const navigate = useNavigate() | ||
|
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.
|
||
| const platform = usePlatform() | ||
|
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.
|
||
| const settings = useSettings() | ||
|
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.
|
||
| const language = useLanguage() | ||
|
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.
|
||
|
|
@@ -153,6 +154,7 @@ export const { use: useNotification, provider: NotificationProvider } = createSi | |
| platform, | ||
| settings, | ||
| language, | ||
| navigate, | ||
| }), | ||
| }), | ||
| owner ?? undefined, | ||
|
|
@@ -217,6 +219,7 @@ function createServerNotificationState(input: { | |
| platform: ReturnType<typeof usePlatform> | ||
| settings: ReturnType<typeof useSettings> | ||
| language: ReturnType<typeof useLanguage> | ||
| navigate: (href: string) => void | ||
| }) { | ||
| const serverSDK = () => input.sdk | ||
| const serverSync = () => input.sync | ||
|
|
@@ -353,7 +356,9 @@ function createServerNotificationState(input: { | |
|
|
||
| const href = `/${base64Encode(directory)}/session/${sessionID}` | ||
| if (settings.notifications.agent()) { | ||
| void platform.notify(language.t("notification.session.responseReady.title"), session.title ?? sessionID, href) | ||
| void platform.notify(language.t("notification.session.responseReady.title"), session.title ?? sessionID, () => | ||
| input.navigate(href), | ||
| ) | ||
|
Comment on lines
+359
to
+361
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.
|
||
| } | ||
| }) | ||
| } | ||
|
|
@@ -386,7 +391,7 @@ function createServerNotificationState(input: { | |
| (typeof error === "string" ? error : language.t("notification.session.error.fallbackDescription")) | ||
| const href = sessionID ? `/${base64Encode(directory)}/session/${sessionID}` : `/${base64Encode(directory)}` | ||
| if (settings.notifications.errors()) { | ||
| void platform.notify(language.t("notification.session.error.title"), description, href) | ||
| void platform.notify(language.t("notification.session.error.title"), description, () => input.navigate(href)) | ||
|
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.
|
||
| } | ||
| }) | ||
| } | ||
|
|
||
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.
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example,
classis a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the
classattribute instead.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.
This is SolidJS, not React; Solid JSX uses the
classattribute, soclassNamewould be incorrect here.