diff --git a/web/src/crate_web/pages/record.gleam b/web/src/crate_web/pages/record.gleam index 9dd7729..60c0238 100644 --- a/web/src/crate_web/pages/record.gleam +++ b/web/src/crate_web/pages/record.gleam @@ -48,7 +48,7 @@ pub fn view(model: Model, detail: EntryDetail) -> Element(Msg) { html.div([attr.class("actions-block")], [ actions(entry.entry_id, model.editing, model.confirm_remove), remove_hint(model.confirm_remove), - amend_footnote(), + rd.actions_footnote(), ]), share_block(model, entry.entry_id), edit_panel(entry, model.editing, model.busy), @@ -320,18 +320,6 @@ fn remove_hint(confirm_remove: Bool) -> Element(Msg) { } } -/// Locally worded rather than `ui/record_detail.actions_footnote` (still on -/// the retired "a fix mints your own version" copy): publishing an amendment -/// saves your own copy of the pressing's catalog fields, it never edits the -/// shared one other crates read from. -fn amend_footnote() -> Element(Msg) { - html.p([attr.class("actions-footnote")], [ - text( - "Publishing an amendment saves your own copy of this pressing's details. It never changes anyone else's.", - ), - ]) -} - fn edit_panel(entry: Entry, editing: Bool, busy: Bool) -> Element(Msg) { case editing { False -> element.none() diff --git a/web/src/crate_web/pages/record_amend.gleam b/web/src/crate_web/pages/record_amend.gleam index 05af429..5e36141 100644 --- a/web/src/crate_web/pages/record_amend.gleam +++ b/web/src/crate_web/pages/record_amend.gleam @@ -14,6 +14,7 @@ import crate_web/msg.{ } import crate_web/ui/controls as ctl import crate_web/ui/forms as frm +import crate_web/ui/record_detail as rd import crate_web/ui/states import gleam/option.{type Option, None, Some} import lustre/attribute as attr @@ -48,7 +49,7 @@ pub fn view(model: Model) -> Element(Msg) { attr.disabled(model.amend_activity != AmendIdle), attr.class("btn--block"), ]), - amend_footnote(), + rd.actions_footnote(), ]) } @@ -98,15 +99,3 @@ fn amend_field(label: String, field: String, value: String) -> Element(Msg) { ]), ]) } - -/// Locally worded rather than `ui/record_detail.amend_footnote` (still on -/// the retired "a fix mints your own version" copy): publishing an amendment -/// saves your own copy of the pressing's catalog fields, it never edits the -/// shared one other crates read from. -fn amend_footnote() -> Element(Msg) { - html.p([attr.class("actions-footnote")], [ - text( - "Publishing an amendment saves your own copy of this pressing's details. It never changes anyone else's.", - ), - ]) -} diff --git a/web/src/crate_web/ui/record_detail.gleam b/web/src/crate_web/ui/record_detail.gleam index cf8fd4f..dd77d85 100644 --- a/web/src/crate_web/ui/record_detail.gleam +++ b/web/src/crate_web/ui/record_detail.gleam @@ -2,7 +2,6 @@ //// layer-section bands (the pressing vs. your record), provenance lines, //// and the shared record-grade vocabulary. -import gleam/dict import gleam/int import gleam/list import gleam/string @@ -81,10 +80,14 @@ pub fn muted_line(body: String) -> Element(msg) { } /// The aside under the record page's actions (and again near the amend -/// screen's publish button): what AMEND/SUGGEST A FIX actually does. +/// screen's publish button): what AMEND actually does. It writes to the +/// visitor's own copy of the pressing, never to the shared catalog entry +/// other crates read from. pub fn actions_footnote() -> Element(msg) { html.p([attr.class("actions-footnote")], [ - text("a fix mints your own version of this pressing; nothing merges"), + text( + "Publishing an amendment saves your own copy of this pressing's details. It never changes anyone else's.", + ), ]) } @@ -95,20 +98,6 @@ pub fn notes(body: String) -> Element(msg) { ]) } -/// A foreign (adopted) pressing gets the shared "suggest a fix" copy; a -/// self-minted one gets `own_label`, whichever wording the caller's screen -/// uses for its own amend action. -pub fn amend_action_label( - via_handles: dict.Dict(String, String), - entry_id: String, - own_label: String, -) -> String { - case dict.get(via_handles, entry_id) { - Ok(_) -> "SUGGEST A FIX" - Error(Nil) -> own_label - } -} - pub const grades = ["M", "NM", "VG+", "VG", "G+", "G", "F", "P"] pub fn grade_name(grade: String) -> String { diff --git a/web/src/crate_web/view.gleam b/web/src/crate_web/view.gleam index 671f3c6..d2b3608 100644 --- a/web/src/crate_web/view.gleam +++ b/web/src/crate_web/view.gleam @@ -28,7 +28,6 @@ import crate_web/pages/settings import crate_web/route import crate_web/ui/app_bar as bar import crate_web/ui/nav -import crate_web/ui/record_detail as rd import crate_web/ui/states import gleam/option.{type Option, None, Some} import lustre/attribute as attr @@ -157,7 +156,7 @@ fn page(model: Model) -> Element(Msg) { } RecordAmend(entry_id) -> sub_page_to( - amend_title(model, entry_id), + "AMEND", route.to_path(Record(entry_id)), element.none(), record_amend.view(model), @@ -196,10 +195,6 @@ fn sub_page_to( ]) } -fn amend_title(model: Model, entry_id: String) -> String { - rd.amend_action_label(model.via_handles, entry_id, "AMEND PRESSING") -} - fn edit_proposal_page(model: Model, id: String) -> Element(Msg) { case model.inbox { model.InboxLoaded(_) -> diff --git a/web/test/record_amend_test.gleam b/web/test/record_amend_test.gleam index 01a1176..792a912 100644 --- a/web/test/record_amend_test.gleam +++ b/web/test/record_amend_test.gleam @@ -130,13 +130,9 @@ pub fn cover_uploaded_failure_surfaces_inline_and_stays_on_the_page_test() { assert effect == empty_effect() } -pub fn record_amend_page_titles_itself_by_the_entrys_provenance_test() { - [ - #(dict.new(), "AMEND PRESSING"), - #(dict.from_list([#("e1", "bob.test")]), "SUGGEST A FIX"), - ] - |> list.each(fn(row) { - let #(via_handles, expected_title) = row +pub fn record_amend_page_titles_itself_amend_regardless_of_provenance_test() { + [dict.new(), dict.from_list([#("e1", "bob.test")])] + |> list.each(fn(via_handles) { let seeded = set_crate( Model(..logged_in(), route: RecordAmend("e1"), via_handles:), @@ -144,7 +140,7 @@ pub fn record_amend_page_titles_itself_by_the_entrys_provenance_test() { ShelfLoaded(Own, [an_entry()]), ) let html = view.view(seeded) |> element.to_string - assert string.contains(html, expected_title) + assert string.contains(html, "AMEND") }) }