mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix(web): keep picker hint clear of comments panel (#1820)
This commit is contained in:
parent
fd80d7c997
commit
15ebe8b266
3 changed files with 44 additions and 1 deletions
|
|
@ -6214,7 +6214,12 @@ function HtmlViewer({
|
|||
&& openHintBox
|
||||
&& !activeInspectTarget
|
||||
&& !activeCommentTarget ? (
|
||||
<div className="inspect-empty-hint-container">
|
||||
<div
|
||||
className={`inspect-empty-hint-container${
|
||||
boardMode && !commentSidePanelCollapsed ? ' comment-side-panel-open' : ''
|
||||
}`}
|
||||
data-testid="inspect-empty-hint-container"
|
||||
>
|
||||
{liveCommentTargets.size === 0 ? (
|
||||
<div
|
||||
className="inspect-empty-hint"
|
||||
|
|
|
|||
|
|
@ -10721,6 +10721,20 @@ button.ghost.mcp-copy-btn:hover:not(:disabled) {
|
|||
pointer-events: none;
|
||||
}
|
||||
|
||||
.inspect-empty-hint-container.comment-side-panel-open {
|
||||
right: 340px;
|
||||
max-width: min(480px, calc(100% - 368px));
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.inspect-empty-hint-container.comment-side-panel-open {
|
||||
left: 14px;
|
||||
right: 14px;
|
||||
top: 54px;
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
.inspect-empty-hint-container button,
|
||||
.inspect-empty-hint-container .close-button {
|
||||
pointer-events: auto;
|
||||
|
|
|
|||
|
|
@ -1176,6 +1176,30 @@ describe('FileViewer tweaks toolbar', () => {
|
|||
expect(screen.queryByText('Already sent to Claude')).toBeNull();
|
||||
});
|
||||
|
||||
it('keeps the picker hint clear of the open comment side panel', () => {
|
||||
render(
|
||||
<FileViewer
|
||||
projectId="project-1"
|
||||
projectKind="prototype"
|
||||
file={htmlPreviewFile()}
|
||||
liveHtml='<html><body><main data-od-id="hero">Hero</main></body></html>'
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByTestId('board-mode-toggle'));
|
||||
|
||||
expect(screen.getByTestId('comment-side-panel')).toBeTruthy();
|
||||
expect(screen.getByTestId('inspect-empty-hint-container').className).toContain(
|
||||
'comment-side-panel-open',
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: /hide comments/i }));
|
||||
|
||||
expect(screen.getByTestId('inspect-empty-hint-container').className).not.toContain(
|
||||
'comment-side-panel-open',
|
||||
);
|
||||
});
|
||||
|
||||
it('does not preload non-open element comments into the picker composer', async () => {
|
||||
const applyingElementComment: PreviewComment = {
|
||||
id: 'comment-element-applying',
|
||||
|
|
|
|||
Loading…
Reference in a new issue