Skip to content

Commit

Permalink
Fix issue #5676: [Bug]: Frontend Hyperlink in Chat window should open…
Browse files Browse the repository at this point in the history
… link in a new tab
  • Loading branch information
openhands-agent committed Dec 18, 2024
1 parent 5498ca1 commit 508468c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/features/chat/chat-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export function ChatMessage({
code,
ul,
ol,
a: ({ href, children }) => (

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

View workflow job for this annotation

GitHub Actions / Lint frontend

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “ChatMessage” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true

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

View workflow job for this annotation

GitHub Actions / Lint frontend

'children' is already declared in the upper scope on line 17 column 3

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

View workflow job for this annotation

GitHub Actions / Fix frontend linting issues

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “ChatMessage” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true

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

View workflow job for this annotation

GitHub Actions / Fix frontend linting issues

'children' is already declared in the upper scope on line 17 column 3
<a href={href} target="_blank" rel="noopener noreferrer">
{children}
</a>
),
}}
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

0 comments on commit 508468c

Please sign in to comment.