Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/components/notifications/item_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ItemComponent < ViewComponent::Base
"Notifications::Missions::SubmissionApproved" => "check-circle",
"Notifications::Missions::SubmissionRejected" => "alert-triangle",
"Notifications::Missions::SubmissionPendingForReviewer" => "clipboard",
"Notifications::ShopOrders::StatusChanged" => "bag"
"Notifications::ShopOrders::StatusChanged" => "bag",
"Notifications::HardwareMovedToOutpost" => "alert-triangle"
}.freeze

attr_reader :notification
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/projects/lookout_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def create
started_at: Time.current
)

# Hardware projects live on Outpost now — nudge the builder there with an
# inbox notification rather than the old on-recorder popup, without blocking
# the recording.
if @project.hardware? && Flipper.enabled?(:hardware_to_outpost, current_user)
Notifications::HardwareMovedToOutpost.notify(recipient: current_user, record: @project)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timelapse nudge lost without inbox

Medium Severity

The recorder Outpost modal was removed for users with only hardware_to_outpost, while the replacement notification is skipped unless week_2_release is enabled for the recipient inside Notification.notify. Those users no longer get any timelapse Outpost nudge.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d92c89. Configure here.

end

render json: session_json(@session), status: :created
end

Expand Down
9 changes: 0 additions & 9 deletions app/javascript/controllers/lookout_capture_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ export default class extends Controller {
this.setText(statusEl, "Your timelapse is ready!");
}
if (showVideo) await this.revealVideo();
this.showHardwareOutpostNotice();
return;
}
if (data.status === "failed") {
Expand Down Expand Up @@ -480,14 +479,6 @@ export default class extends Controller {
}
}

// Hardware moved to Outpost — once the timelapse is done, let the builder know.
// The notice is only rendered on the page for hardware projects with the flag
// on, so this is a no-op everywhere else.
showHardwareOutpostNotice() {
const dialog = document.getElementById("hardware-outpost-modal");
if (dialog && !dialog.open) dialog.showModal();
}

close(event) {
if (event) event.preventDefault();
this.cleanup();
Expand Down
19 changes: 19 additions & 0 deletions app/models/notifications/hardware_moved_to_outpost.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Notifications
# Heads-up that hardware projects live on Hack Club Outpost now, surfaced when
# a hardware project records a Lookout timelapse (replaces the old on-recorder
# popup). Inbox-only (low priority — no Slack/email), and aggregatable so a
# builder who records repeatedly keeps a single unread notice rather than a
# pile of them.
class HardwareMovedToOutpost < ::Notification
self.default_priority = :low
self.aggregatable = true
self.category_key = :hardware_moved_to_outpost
self.category_label = "Hardware moved to Outpost"
self.category_description = "Hardware projects have moved to Hack Club Outpost"
self.category_group = "General"

def preview_text
"Building hardware? It all happens over on Hack Club Outpost now."
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing aggregate group key

Medium Severity

HardwareMovedToOutpost sets aggregatable but leaves the default build_group_key (nil). Other aggregatable notification types define a non-nil key so the partial unique index can dedupe unread rows; with a nil group_key, concurrent notify calls can each insert a separate unread notification instead of one aggregated notice.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d92c89. Configure here.

end
end
1 change: 1 addition & 0 deletions app/models/notifications/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module Registry
Notifications::Payouts::ShipEventIssued
Notifications::Payouts::VoteDeficitBlocked
Notifications::ShopOrders::StatusChanged
Notifications::HardwareMovedToOutpost
].freeze

module_function
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<span class="notifications-item__verb">Hardware projects have moved to</span>
<%= link_to "Hack Club Outpost", "https://outpost.hackclub.com",
class: "notifications-item__actor",
target: "_blank", rel: "noopener" %>
6 changes: 0 additions & 6 deletions app/views/projects/lookout_sessions/record.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,3 @@
hidden: true %>
</section>
</main>

<%# Hardware moved to Outpost — once this timelapse finishes, the capture
controller pops this notice (rendered only for hardware projects). %>
<% if @project.hardware? && Flipper.enabled?(:hardware_to_outpost, current_user) %>
<%= render "projects/hardware_outpost_modal" %>
<% end %>