Skip to content

Double click opens project details#2911

Merged
DocMoebiuz merged 3 commits intomainfrom
2781/dbl-click-opens-project-detail
Apr 15, 2026
Merged

Double click opens project details#2911
DocMoebiuz merged 3 commits intomainfrom
2781/dbl-click-opens-project-detail

Conversation

@DocMoebiuz
Copy link
Copy Markdown
Collaborator

@DocMoebiuz DocMoebiuz commented Apr 15, 2026

On the dashboard, you can now double click on either the project card or one of the items from the project list to access the project detail view.

  • Double click on project card takes you to details
  • Double click on project list item takes you to details
  • Playwright tests are in place
  • i18n - not relevant

fixes #2781

Copilot AI review requested due to automatic review settings April 15, 2026 09:15
@DocMoebiuz DocMoebiuz changed the title 2781/dbl click opens project detail Double click opens project details Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates project navigation interactions to open the config view from project cards/list items, addressing the reported “card click doesn’t open project” behavior.

Changes:

  • Added double-click navigation from the main project card to /config.
  • Added double-click navigation from project list items to /config.
  • Updated/added Playwright coverage for title-click and double-click navigation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/MobiFlightConnector/frontend/tests/Dashboard.spec.ts Adds/adjusts E2E tests for navigating to the config page via title click and double click.
src/MobiFlightConnector/frontend/src/components/project/ProjectListItem.tsx Adds onDoubleClick navigation for project list items.
src/MobiFlightConnector/frontend/src/components/project/ProjectCard.tsx Adds onDoubleClick navigation for the project card container.

Comment on lines +167 to +170
const navigate = useNavigate()
const navigateToProject = () => {
navigate(`/config`)
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

navigateToProject is now implemented both in ProjectCardTitle and again in ProjectCard with identical logic. This duplicates routing behavior in the same file, making future route changes easy to miss. Consider extracting a shared helper/hook or passing a single handler down so there’s one source of truth for navigation.

Copilot uses AI. Check for mistakes.
Comment on lines 45 to 48
ref={ref}
{...props}
onDoubleClick={navigateToProject}
>
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This onDoubleClick navigates unconditionally to /config. In the recent-projects list, a single click can trigger the unsaved-changes confirmation flow via onSelect (see ProjectMainCard.confirmLoadProject). A double-click will still fire this handler after the clicks, potentially navigating away even when the confirmation dialog should block changing projects. Consider delegating the double-click behavior to the same selection/confirmation logic (or disabling navigation when a confirmation is pending).

Copilot uses AI. Check for mistakes.
Comment on lines 229 to 231
// Verify we navigate to config route
await currentProjectCard.getByRole("button").nth(0).click()
await expect(page).toHaveURL(/.*\/config((\/|\?).*)?/)
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The locator currentProjectCard.getByRole("button").nth(0) is brittle because the card contains multiple buttons and the DOM order can change. Prefer a more specific, user-facing locator (e.g., targeting the project title by text or adding a dedicated data-testid/accessible name for the clickable title area) to reduce flakiness.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +234 to +245
test("Navigate to project view via double click on card", async ({
dashboardPage,
page,
}) => {
await dashboardPage.gotoPage()
await dashboardPage.mobiFlightPage.initWithTestData()

const currentProjectCard = page.getByTestId("project-card")
await currentProjectCard.first().dblclick()

await expect(page).toHaveURL(/.*\/config((\/|\?).*)?/)
})
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new tests validate double click navigation, but the linked bug report expects navigation on a normal single click anywhere on the project card. If the intended fix is single-click, update the implementation and tests accordingly; otherwise, the PR description/issue linkage should be adjusted because this won’t validate the reported behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 210 to 213
<div
data-testid="project-card"
onDoubleClick={navigateToProject}
{...otherProps}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked issue (#2781) describes a single click on the project card not opening the project, but this change only adds an onDoubleClick handler. A double-click requirement won’t resolve the reported behavior for users who click once. Consider handling onClick on the card (and stopping propagation for inner buttons/menus as needed), or otherwise align the PR description/issue linkage with the intended UX.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions
Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@DocMoebiuz DocMoebiuz merged commit 56a6a87 into main Apr 15, 2026
2 checks passed
@DocMoebiuz DocMoebiuz added the enhancement Improvement of an existing feature label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking on a project card doesn't do anything

2 participants