Skip to content

feat: share training blocks across coaches - #158

Merged
denis1011101 merged 2 commits into
mainfrom
feature/shared-training-blocks
Aug 25, 2026
Merged

feat: share training blocks across coaches#158
denis1011101 merged 2 commits into
mainfrom
feature/shared-training-blocks

Conversation

@denis1011101

Copy link
Copy Markdown
Owner

Общий блок GetCourt виден любому организатору: галка в форме игры и в библиотеке отправляет блок в общие, и он появляется в конструкторе даже когда тренер не выбран.

Блоки уже собранного плана остаются в списке, даже если их убрали из общих: иначе правка игры молча теряла бы часть занятия.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c29f9a371

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/controllers/games_controller.rb Outdated

render partial: "games/training_plan_library", locals: {
blocks: TrainingBlock.where(user_id: owner_ids).ordered,
blocks: TrainingBlock.available_for(owner_ids).ordered,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve unshared plan blocks during library reload

When editing a game whose plan contains a formerly shared block from an unselected coach, the initial page includes it through planned_training_block_ids, but changing either coach triggers reloadLibrary, which sends the checked block IDs and replaces the library HTML. This query ignores those IDs, so the block disappears and the next save silently removes it from the plan. The fragment needs an authorized way to include blocks already attached to the edited game, rather than trusting arbitrary submitted IDs.

Useful? React with 👍 / 👎.

denis1011101 and others added 2 commits August 25, 2026 18:02
Общий блок GetCourt виден любому организатору: галка в форме игры и в
библиотеке отправляет блок в общие, и он появляется в конструкторе даже
когда тренер не выбран.

Блоки уже собранного плана остаются в списке, даже если их убрали из
общих: иначе правка игры молча теряла бы часть занятия.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Смена тренера перезагружает библиотеку, и блок из уже собранного плана
пропадал из списка, а следующее сохранение молча выкидывало его из плана.
Фрагмент берёт план из самой игры и только если её можно редактировать:
присланным id верить нельзя.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@denis1011101
denis1011101 force-pushed the feature/shared-training-blocks branch from 6c29f9a to 5d8837e Compare August 25, 2026 13:05
@denis1011101
denis1011101 merged commit 568f44b into main Aug 25, 2026
4 checks passed
@denis1011101
denis1011101 deleted the feature/shared-training-blocks branch September 4, 2026 21:37
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.

1 participant