From 5180aad88bf48ee2436de4c5cd41ccb4a32dfbcd Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 19 Jan 2026 21:01:07 +0200 Subject: [PATCH 1/4] feat: 3.13.0 --- data/dev.geopjr.Collision.metainfo.xml.in | 11 +++++++++++ data/ui/application.ui | 4 ++-- po/dev.geopjr.Collision.pot | 10 ++++++++++ shard.yml | 2 +- src/collision/window.cr | 10 +++++----- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/data/dev.geopjr.Collision.metainfo.xml.in b/data/dev.geopjr.Collision.metainfo.xml.in index 42404541..e020f9f8 100644 --- a/data/dev.geopjr.Collision.metainfo.xml.in +++ b/data/dev.geopjr.Collision.metainfo.xml.in @@ -48,6 +48,17 @@ #26a269 + + +
    +
  • Added a beautiful drop overlay when drag and dropping files
  • +
  • Fixed issues with the checksum text input
  • +
  • Title will be hidden now when unused
  • +
  • Files pending to be hashed will now reflect that in the progress bar
  • +
  • Collision will now gracefully handle closing windows that have pending operations
  • +
+
+
    diff --git a/data/ui/application.ui b/data/ui/application.ui index b04b3045..c21122eb 100644 --- a/data/ui/application.ui +++ b/data/ui/application.ui @@ -64,6 +64,7 @@ + 0 False @@ -81,10 +82,9 @@ - + wide resultsStack - 0 diff --git a/po/dev.geopjr.Collision.pot b/po/dev.geopjr.Collision.pot index 61e4e447..5853d60c 100644 --- a/po/dev.geopjr.Collision.pot +++ b/po/dev.geopjr.Collision.pot @@ -184,3 +184,13 @@ msgstr "" #: src/collision/functions/feedback.cr:204 msgid "They Don't Match" msgstr "" + +#. Text on top of the progressbar when waiting for a different window to finish first +#: src/window.cr:164 data/ui/application.ui:152 +msgid "Pending" +msgstr "" + +#. translators: overlay shown when dragging files above it +#: data/ui/application.ui:48 +msgid "Drop to hash" +msgstr "" diff --git a/shard.yml b/shard.yml index d61fdd5b..7542f400 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: collision -version: 3.12.1 +version: 3.13.0 authors: - GeopJr diff --git a/src/collision/window.cr b/src/collision/window.cr index 7b5a4104..0333bd27 100644 --- a/src/collision/window.cr +++ b/src/collision/window.cr @@ -8,7 +8,7 @@ module Collision "welcomeBtn", "mainStack", "fileInfo", - "headerbarViewSwitcher", + "header_bar", "openFileBtn", "compareBtn", "verifyOverlayLabel", @@ -31,7 +31,7 @@ module Collision HOST_PATH_ATTR = "xattr::document-portal.host-path" @hash_rows = Hash(Symbol, Widgets::HashRow).new - @headerbarViewSwitcher : Adw::ViewSwitcher + @header_bar : Adw::HeaderBar @welcomeBtn : Gtk::Button @compareBtn : Gtk::Button @compareBtnImage : Gtk::Image @@ -88,7 +88,7 @@ module Collision end @mainStack.visible_child_name = "results" - @headerbarViewSwitcher.visible = true + @header_bar.show_title = true @openFileBtn.visible = true @switcher_bar.visible = true flow_queue @@ -164,7 +164,7 @@ module Collision @progressbar.text = Gettext.gettext("Pending") @progressbar.fraction = 0.0 @mainStack.visible_child_name = "spinner" - @headerbarViewSwitcher.visible = false + @header_bar.show_title = false @openFileBtn.visible = false @switcher_bar.visible = false reset_feedback @@ -293,7 +293,7 @@ module Collision @verifyFeedback = Gtk::Image.cast(template_child("verifyFeedback")) @mainStack = Gtk::Stack.cast(template_child("mainStack")) - @headerbarViewSwitcher = Adw::ViewSwitcher.cast(template_child("headerbarViewSwitcher")) + @header_bar = Adw::HeaderBar.cast(template_child("header_bar")) @switcher_bar = Adw::ViewSwitcherBar.cast(template_child("switcher_bar")) @mainDnd = Gtk::DropTarget.cast(template_child("mainDnd")) @compareDnd = Gtk::DropTarget.cast(template_child("compareDnd")) From 7ecb4b55600783427ef49eec12e49f064b365d7a Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 19 Jan 2026 21:04:44 +0200 Subject: [PATCH 2/4] feat: bump screenshots --- data/screenshots/screenshot-1.png | 4 ++-- data/screenshots/screenshot-2.png | 4 ++-- data/screenshots/screenshot-3.png | 4 ++-- data/screenshots/screenshot-4.png | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/screenshots/screenshot-1.png b/data/screenshots/screenshot-1.png index a08ac062..dfa34820 100644 --- a/data/screenshots/screenshot-1.png +++ b/data/screenshots/screenshot-1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b28b5b87d2c1098a7cce3f1a9c71732601e6913e0617db718975a48fd5da0bbb -size 46617 +oid sha256:16fe673d6bbf41ba15aca101731a0fdd6def3f9abda126292ee17ff2008b6a51 +size 59504 diff --git a/data/screenshots/screenshot-2.png b/data/screenshots/screenshot-2.png index 20169709..9bd03302 100644 --- a/data/screenshots/screenshot-2.png +++ b/data/screenshots/screenshot-2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6bef3291f08a69127c248e909ca3b395381e8988c4f41bcb289c1efef1a4df25 -size 29443 +oid sha256:b353c5733865f1bb3673443238b39aee474d61be0b9fca65768e7bfd8c450986 +size 39595 diff --git a/data/screenshots/screenshot-3.png b/data/screenshots/screenshot-3.png index ad2aaf96..b6922360 100644 --- a/data/screenshots/screenshot-3.png +++ b/data/screenshots/screenshot-3.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f225e0a6462d9c3e151ced3d6cf127b5946aef1abb86c0ca753b0cb5dce4adda -size 33601 +oid sha256:b2aef7577eaf96d3b4b57202587ec7bb30f8b502e9038849a06d2a5f2debc632 +size 64606 diff --git a/data/screenshots/screenshot-4.png b/data/screenshots/screenshot-4.png index cc6a2af1..6e716d0d 100644 --- a/data/screenshots/screenshot-4.png +++ b/data/screenshots/screenshot-4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7aa8a7020d54aaf11f846adb6a7929953b724a3a06957afd7952646564bb0f20 -size 21622 +oid sha256:e19381e4abb24811d023a6cbbf0c9119536be52d015ce0aace8e09d8f1d17afe +size 21539 From d1c30ee6e7191ffd353bb52573e7072679ae4d11 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 19 Jan 2026 21:19:32 +0200 Subject: [PATCH 3/4] feat: support older crystal versions --- spec/hash_generator_spec.cr | 6 +++++- src/collision/functions/checksum.cr | 13 +++++++++++-- src/collision/window.cr | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/spec/hash_generator_spec.cr b/spec/hash_generator_spec.cr index 18c7bf65..0c914d80 100644 --- a/spec/hash_generator_spec.cr +++ b/spec/hash_generator_spec.cr @@ -6,7 +6,11 @@ describe Collision::Checksum do path = Path["./spec/test.txt"].expand(home: true) hashes = Hash(Symbol, String).new channel = Channel(Hash(String, String)).new - mt_context = Fiber::ExecutionContext::Parallel.new("worker-threads", 8) + {% if Fiber::ExecutionContext.has_constant?(:Parallel) %} + mt_context = Fiber::ExecutionContext::Parallel.new("worker-threads", 8) + {% else %} + mt_context = Fiber::ExecutionContext::MultiThreaded.new("worker-threads", 8) + {% end %} Collision::CLIPBOARD_HASH.keys.each do |x| hashes[x] = "" diff --git a/src/collision/functions/checksum.cr b/src/collision/functions/checksum.cr index b21be019..50f182c0 100644 --- a/src/collision/functions/checksum.cr +++ b/src/collision/functions/checksum.cr @@ -22,8 +22,17 @@ module Collision end class Checksum - @mt_context : Fiber::ExecutionContext::Parallel = Fiber::ExecutionContext::Parallel.new("worker-threads", 8) - @s_context = Fiber::ExecutionContext::Concurrent.new("channel-receiver") + {% if Fiber::ExecutionContext.has_constant?(:Parallel) %} + @mt_context : Fiber::ExecutionContext::Parallel = Fiber::ExecutionContext::Parallel.new("worker-threads", 8) + {% else %} + @mt_context : Fiber::ExecutionContext::MultiThreaded = Fiber::ExecutionContext::MultiThreaded.new("worker-threads", 8) + {% end %} + + {% if Fiber::ExecutionContext.has_constant?(:Concurrent) %} + @s_context = Fiber::ExecutionContext::Concurrent.new("channel-receiver") + {% else %} + @s_context = Fiber::ExecutionContext::SingleThreaded.new("channel-receiver") + {% end %} def calculate(type : Symbol, filename : String) : String hash = diff --git a/src/collision/window.cr b/src/collision/window.cr index 0333bd27..dd740d32 100644 --- a/src/collision/window.cr +++ b/src/collision/window.cr @@ -227,7 +227,8 @@ module Collision @compareBtnLabel.label = file_path.basename.to_s @compareBtnLabel.tooltip_text = file_path.basename.to_s - (Fiber::ExecutionContext::Concurrent.new("compare-tool")).spawn do + + ({{ Fiber::ExecutionContext.has_constant?(:Concurrent) ? Fiber::ExecutionContext::Concurrent : Fiber::ExecutionContext::SingleThreaded }}.new("compare-tool")).spawn do compareFileSHA256 = Collision::Checksum.new.calculate(:sha256, file.path.to_s) result = @hash_results[:sha256] == compareFileSHA256 result = Collision::FileUtils.compare_content(file_path, @hash_results.values) if !result && File.size(file_path) < MAX_COMPARE_READ_SIZE From 39bf0bc0e0b66e5bca893266515559376a1bcbb2 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 19 Jan 2026 21:26:21 +0200 Subject: [PATCH 4/4] fix(spec): macro --- spec/hash_generator_spec.cr | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/hash_generator_spec.cr b/spec/hash_generator_spec.cr index 0c914d80..c4390440 100644 --- a/spec/hash_generator_spec.cr +++ b/spec/hash_generator_spec.cr @@ -6,11 +6,7 @@ describe Collision::Checksum do path = Path["./spec/test.txt"].expand(home: true) hashes = Hash(Symbol, String).new channel = Channel(Hash(String, String)).new - {% if Fiber::ExecutionContext.has_constant?(:Parallel) %} - mt_context = Fiber::ExecutionContext::Parallel.new("worker-threads", 8) - {% else %} - mt_context = Fiber::ExecutionContext::MultiThreaded.new("worker-threads", 8) - {% end %} + mt_context = {{ Fiber::ExecutionContext.has_constant?(:Parallel) ? Fiber::ExecutionContext::Parallel : Fiber::ExecutionContext::MultiThreaded }}.new("worker-threads", 8) Collision::CLIPBOARD_HASH.keys.each do |x| hashes[x] = ""