Skip to content
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

Fix issue #5676: [Bug]: Frontend Hyperlink in Chat window should open link in a new tab #5677

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions frontend/src/components/features/chat/chat-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
import { ul, ol } from "../markdown/list";
import { CopyToClipboardButton } from "#/components/shared/buttons/copy-to-clipboard-button";

function MarkdownLink({

Check failure on line 9 in frontend/src/components/features/chat/chat-message.tsx

View workflow job for this annotation

GitHub Actions / Lint frontend

Replace `⏎··href,⏎··children,⏎··...props⏎}:·React.ComponentProps<'a'` with `·href,·children,·...props·}:·React.ComponentProps<"a"`
href,

Check failure on line 10 in frontend/src/components/features/chat/chat-message.tsx

View workflow job for this annotation

GitHub Actions / Lint frontend

'href' is missing in props validation
children,
...props
}: React.ComponentProps<'a'>) {
return (
<a href={href} target="_blank" rel="noopener noreferrer" {...props}>

Check failure on line 15 in frontend/src/components/features/chat/chat-message.tsx

View workflow job for this annotation

GitHub Actions / Lint frontend

Prop spreading is forbidden
{children}
</a>
);
}

interface ChatMessageProps {
type: "user" | "assistant";
message: string;
Expand Down Expand Up @@ -62,6 +74,7 @@
code,
ul,
ol,
a: MarkdownLink,
}}
remarkPlugins={[remarkGfm]}
>
Expand Down
1 change: 1 addition & 0 deletions openhands/server/session/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ async def _cleanup_detached_conversations(self):
except Exception:
logger.warning('error_cleaning_detached_conversations', exc_info=True)
await asyncio.sleep(15)

async def init_or_join_session(
self, sid: str, connection_id: str, session_init_data: SessionInitData
):
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ reportlab = "*"
[tool.coverage.run]
concurrency = ["gevent"]


[tool.poetry.group.runtime.dependencies]
jupyterlab = "*"
notebook = "*"
Expand Down Expand Up @@ -129,6 +130,7 @@ ignore = ["D1"]
[tool.ruff.lint.pydocstyle]
convention = "google"


[tool.poetry.group.evaluation.dependencies]
streamlit = "*"
whatthepatch = "*"
Expand Down
Loading