Skip to content

Conversation

webfiltered
Copy link
Contributor

@webfiltered webfiltered commented Sep 15, 2025

Summary

Adds hover-based copy button to Logs pane, Desktop terminal, and Desktop start view, with smart selection handling.

Changes

  • Copy button appears on hover at top-right of terminal
  • Respects existing text selection (copies selection if present, all text otherwise)
  • Dynamic tooltip shows "Copy selection" or "Copy all" based on state
  • Proper opacity transitions and hover states
  • Adds component tests

Screenshots

Top right -->

image

Desktop server start view

image

┆Issue is synchronized with this Notion page by Unito

@webfiltered webfiltered added the Design Used to request Product feedback on design decisions label Sep 15, 2025
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 15, 2025
Copy link

github-actions bot commented Sep 15, 2025

🎭 Playwright Test Results

All tests passed!

⏰ Completed at: 09/15/2025, 11:45:32 PM UTC

📈 Summary

  • Total Tests: 450
  • Passed: 421 ✅
  • Failed: 0
  • Flaky: 0
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 414 / ❌ 0 / ⚠️ 0 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@webfiltered
Copy link
Contributor Author

Note: Based on #5563, which should be merged first

@webfiltered
Copy link
Contributor Author

N.B. This also affects web frontend - in the logs drawer. First screenshot is Chrome. PR says "terminal" mostly because it's xterm running the show. Adding explicitness.

@DrJKL DrJKL self-assigned this Sep 15, 2025
emit('created', terminalData, rootEl)
const { terminal } = terminalData
let selectionDisposable: IDisposable | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

I usually see mutable variables like this as a red flag. Should this be a ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I always check let usage, because it's usually not what I want. This, afaik, has always been the frontend pattern for this type of value.

Is there any actual benefit to having this be a ref? Seems like it would just add needless overhead for what this is actually used for?

Copy link
Contributor

Choose a reason for hiding this comment

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

One benefit would be fewer lets 😁

It would also let you more safely reference and reset the value in the lifecycle hooks.

})
onUnmounted(() => {
selectionDisposable?.dispose()
Copy link
Contributor

Choose a reason for hiding this comment

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

If you change selectionDisposable to be a ref, you can also use https://vueuse.org/shared/refManualReset/ to prevent double disposals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I'm missing the point, this one feels like attempting to guard against internal Vue failures. My gut reaction is that we should trust the framework to honour its lifecycle. If our framework lifecycle is broken, the app really should just stop executing.

}))
}))

const mockTerminal = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an interface you can declare that this satisfies?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, could you move this into the mock as a cached value to prevent direct access?

PabloWiedemann
PabloWiedemann previously approved these changes Sep 15, 2025
Copy link

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Prettier formatting

DrJKL
DrJKL previously approved these changes Sep 15, 2025
})
const handleCopy = async () => {
const { terminal } = terminalData
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this already present in scope?

Copy link

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Prettier formatting

@webfiltered webfiltered merged commit b8d8193 into main Sep 16, 2025
21 checks passed
@webfiltered webfiltered deleted the copy-startup-terminal branch September 16, 2025 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:desktop Design Used to request Product feedback on design decisions size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants