Skip to content

Conversation

MrFastDie
Copy link

I made a POC for being able to copy code blocks and pasting images.

I had to also include https://github.com/1runeberg/code_highlight_view as a replacement for highlight, as the other one did not receive any updates in centuries.

However, this is only tested on Linux as I do not have other platforms to test, and I don't really have a high interest on setting up cross-platform deployment.

As I really like Fluffychat as an alternative to Element that breaks every second breath you take, I'd like to add my comfort features. However, I do not really feel able to take Ownership of testing and maintaining these features as I basically don't have any experience within flutter.

  • Code formatting and import sorting has been done with dart format lib/ test/ and dart run import_sorter:main --no-comments
  • The commit message uses the format of Conventional Commits
  • The commit message describes what has been changed, why it has been changed and how it has been changed
  • Every new feature or change of the design/GUI is linked to an approved design proposal in an issue I changed the default theme for code as it's somehow a little broken / ugly with the replacement lib - I also included a hover button to copy the code
  • Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership

Pull Request has been tested on:

  • Android
  • iOS
  • Browser (Chromium based)
  • Browser (Firefox based)
  • Browser (WebKit based)
  • Desktop Linux
  • Desktop Windows
  • Desktop macOS

@MrFastDie MrFastDie requested a review from krille-chan as a code owner July 22, 2025 10:44
@MrFastDie MrFastDie changed the title Selectable code Selectable code and pasting of images Jul 22, 2025
room.sendFileEvent(
file,
MatrixFile(
bytes: bytes, mimeType: 'image/png', name: 'pasted.png'),

Choose a reason for hiding this comment

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

The mimetype is wrong, on android it's passed from the OS as-is (maybe it could be jpg or others?), on windows it's definitely always BMP though. The underlying library is not very transparent about this and this just seems to be an implementation detail.

Also previously the dependencies for pasteboard were more incorporated in the build process, I don't know if this is relevant here to this PR though.

This seems to have been previously implemented but regressed here: dda45f7
And the dependency you re-added was removed here: 933119a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants