Skip to content

ALT-11032#48

Merged
Tsyklop merged 9 commits into
mainfrom
feat/ALT-11032
Jun 26, 2026
Merged

ALT-11032#48
Tsyklop merged 9 commits into
mainfrom
feat/ALT-11032

Conversation

@Tsyklop

@Tsyklop Tsyklop commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

ALT-11032: Suggest sharing achievement on Hyperskill project completion

Summary

Adds a "share your achievement" flow that congratulates the user when they complete a Hyperskill project and offers to post about it on X or LinkedIn.

What's new

Project-completion suggestion

  • New SuggestToPostOnProjectCompletionListener (registered as a checkListener) detects when the whole Hyperskill project lesson becomes solved.
  • The dialog is shown only when:
    • the course is a HyperskillCourse in study mode,
    • the solved task belongs to the project lesson and all of its tasks are now solved,
    • the task just transitioned to Solved (it is not shown when re-checking an already-solved task).
  • Policy logic lives in SocialMediaUtils.shouldSuggestToPost and is fully covered by tests.

Share dialog

  • A modal "Congratulations!" dialog with a selectable/copyable achievement message and a DPI-aware banner image.
  • Share on X and Share on LinkedIn buttons open the corresponding web share intents; the dialog stays open so the user can post to both networks.
  • Share URLs point to hyperskill.org/courses with the agreed UTM tracking parameters. For X the tracked URL goes in the url intent parameter; for LinkedIn (no url param) it's embedded into the post text.
  • A "Don't ask again" checkbox persists the opt-out (even when closing via Cancel).

Settings

  • New SocialMediaSettings app-level service (hyperskill.xml) storing the askToPost preference.
  • New SocialMediaOptionsProvider settings page lets the user re-enable the suggestion after opting out.

Image rendering

  • ScaledBannerIcon keeps the full-resolution source and downscales to the exact device size at paint time using progressive multi-step bicubic scaling, so the banner stays crisp at any DPI. Result is cached per device size.

Build

  • New buildAllVersions Gradle task builds the plugin for multiple platform versions (252, 253, 261) in parallel, each in an isolated git worktree, collecting distributions into build/dist-all. Supports -Pversions= and -Pref=.
  • Removed the obsolete socialMedia .gif copy step from PrepareSandboxTask; achievement assets are now bundled as resources (project_complete.png).

Testing

  • SuggestToPostOnProjectCompletionListenerTest drives the real EP-registered listener through check scenarios, asserting the dialog shows/doesn't show for: full project solved, partial project, non-project task, re-solving a solved task, and the disabled-in-settings case. A mockable SuggestToPostDialogUI is used in unit-test mode.

User-facing strings

New social.media.* keys added to EduCoreBundle.properties (dialog title, share/close buttons, "Don't ask again", achievement message, settings labels).

@meanmail meanmail left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one issue in the new build helper task.

Comment thread build.gradle.kts Outdated
@Tsyklop Tsyklop requested a review from meanmail June 26, 2026 08:46

@meanmail meanmail left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. The previous build-task issue is addressed by removing the task.

@Tsyklop Tsyklop merged commit f468da8 into main Jun 26, 2026
2 of 3 checks passed
@Tsyklop Tsyklop deleted the feat/ALT-11032 branch June 26, 2026 09:17
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.

3 participants