Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
47 changes: 47 additions & 0 deletions app/components/forms/experience_description_input.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module Forms
class ExperienceDescriptionInput < Plutonium::UI::Component::Base
CHECKLIST_ITEMS = [
"I explained what I owned or was responsible for.",
"I described what I built, improved, or solved.",
"I included the result or impact, with numbers where possible.",
"I added collaboration, leadership, or important constraints when relevant."
].freeze

def initialize(field:)
@field = field
end

def view_template
div(class: "space-y-4") do
render @field.markdown_tag
checklist
end
end

private

def checklist
fieldset(class: "experience-description-checklist rounded-[var(--pu-radius-lg)] border border-[var(--pu-border)] bg-[var(--pu-surface-alt)] p-4") do
legend(class: "px-1 text-sm font-semibold text-[var(--pu-text)]") { "Description checklist" }
p(class: "mb-3 text-xs text-[var(--pu-text-muted)]") do
"Check each item when your description covers it. These checks are for your review and are not saved."
end

div(class: "grid gap-3 sm:grid-cols-2") do
CHECKLIST_ITEMS.each_with_index do |item, index|
label(class: "flex cursor-pointer items-start gap-2 text-sm text-[var(--pu-text)]") do
# Deliberately omit `name`: these are private, temporary prompts
# and can never become submitted Experience attributes.
input(
type: "checkbox",
id: "experience-description-check-#{index}",
class: "pu-checkbox mt-0.5 shrink-0"
)
span { item }
end
end
end
end
end
end
end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/screenshots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ their env vars were set; no Slack messages were sent.
| 17-profile-connected | A profile seen by a connection: follow state, endorse buttons, projects |
| 18-network | Developer portal network page, "People you may know" |
| 19-credits | Credits: projects you've been added to, to confirm or decline |
| 20-experience-description-checklist | New experience form with description guidance and a private self-review checklist |
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class ExperienceDefinition < Developers::ResourceDefinition
hint: "Choose skills already listed on your profile.",
choices: ->(form) { form.view_context.current_scoped_entity.profile_skills.includes(:skill).order("skills.name") },
wrapper: {class: "col-span-full"}
# Keep the persisted field unchanged while wrapping its Markdown editor in
# frontend-only writing guidance and self-review controls.
input :description,
hint: "Describe your contribution, not just the role. Use 2–4 short bullets." do |field|
render Forms::ExperienceDescriptionInput.new(field:)
end
input :ended_on, hint: "Leave blank if this is your current role"
field :started_on, label: "Started"
field :ended_on, label: "Ended"
Expand Down
27 changes: 27 additions & 0 deletions test/integration/developer_portal_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ class DeveloperPortalTest < ActionDispatch::IntegrationTest
assert_equal [elixir], experience.profile_skills.reload
end

test "shows frontend-only guidance for an experience description" do
get "/developer/ada/developers/experiences/new"
assert_response :success
assert_includes response.body, "Describe your contribution, not just the role. Use 2–4 short bullets."
assert_description_checklist

experience = @profile.experiences.create!(
title: "Analyst",
company_name: "Analytical Engines",
started_on: Date.new(1842, 1, 1)
)
get "/developer/ada/developers/experiences/#{experience.id}/edit"
assert_response :success
assert_description_checklist
end

test "adds skills from the shared taxonomy" do
skill = Skill.create!(name: "Ruby")

Expand All @@ -90,4 +106,15 @@ class DeveloperPortalTest < ActionDispatch::IntegrationTest

assert_equal [skill], @profile.skills.to_a
end

private

def assert_description_checklist
assert_select ".experience-description-checklist" do
assert_select "legend", text: "Description checklist"
assert_select "input[type=checkbox]:not([name])", count: 4
assert_select "details", count: 0
assert_select "p", text: /not saved/
end
end
end
Loading