fix(site): keep activity bump editable when allow_user_autostop is on (#27083) - #27144
Merged
Conversation
…#27083) > 🤖 This PR was written by Coder Agents on behalf of Jake Howell. The UI guard added in #22112 disabled the `Activity bump` field and cleared its saved value whenever the template's `Default autostop` was 0. It did not check the "Allow users to customize autostop duration for workspaces" (`allow_user_autostop`) setting, so templates that relied on user-defined autostop timers had their `activity_bump_ms` silently cleared when saving in the Coder UI. Enable the field, preserve the value on submit, and update the helper text when either `default_ttl_ms > 0` or `allow_user_autostop` is true. Closes [DEVEX-438](https://linear.app/codercom/issue/DEVEX-438/allow-user-autostop-default-autostop-disabled-causes-activity-bump-to). > **Note:** This needs to be backported to 2.34 (ESR). <details> <summary>Implementation notes</summary> [#22112](#22112) introduced a UI guard that: 1. Disables the `Activity bump (hours)` field when `default_ttl_ms === 0`. 2. Sends `activity_bump_ms: undefined` on submit under the same condition, which the backend treats as "do not update", but combined with the disabled state users cannot re-enter a value once cleared and the previously stored value effectively becomes orphaned. The guard ignored `allow_user_autostop`. When that setting is enabled, workspaces still have a scheduled stop (whatever the user configures on their workspace), so `activity_bump_ms` is still meaningful. Broaden the guard to consider both signals. The field is only disabled and the value only discarded when **both** `default_ttl_ms === 0` **and** `allow_user_autostop === false`. Changes: - `TemplateScheduleForm.tsx` - `disabled` prop now checks `!default_ttl_ms && !allow_user_autostop`. - Submit path preserves `activity_bump_ms` when either signal is truthy. - Passes `allowUserAutostop` through to the helper text. - `TTLHelperText.tsx` - `ActivityBumpHelperText` accepts `allowUserAutostop` and only shows the "no scheduled stop" hint when neither signal is set. Updated copy mentions both signals. - Tests and stories - Existing tests explicitly uncheck `allow_user_autostop` before asserting the guard fires (since `MockTemplate.allow_user_autostop` defaults to `true`). - Added coverage: guard stays off when only `allow_user_autostop` is enabled; toggling `allow_user_autostop` re-enables the field without touching `default_ttl_ms`. - Added a story that verifies `activity_bump_ms` is preserved on submit when `allow_user_autostop` is enabled and `default_ttl_ms` is 0. </details> (cherry picked from commit 1eea4a7)
jakehwll
force-pushed
the
backport/27083-to-2.34
branch
from
July 13, 2026 02:53
92de4d9 to
f4da76c
Compare
jakehwll
changed the base branch from
backport/25848-to-2.34
to
fix/bedrock-provider-form-story-2.34
July 14, 2026 02:15
mtojek
pushed a commit
that referenced
this pull request
Jul 14, 2026
…rock story (#27211) > 🤖 This PR was written by Coder Agents on behalf of Jake Howell. Test-only fix for `release/2.34`. ### Problem The `AddBedrockWithoutStaticCredentials` interaction test in `ProviderForm.stories.tsx` asserts: ```ts expect(args.onSubmit).toHaveBeenCalledWith(expect.objectContaining({ type: "bedrock", ... })) ``` Formik invokes `onSubmit(values, formikHelpers)` with **two** arguments, so `toHaveBeenCalledWith` never matches and the storybook/Chromatic interaction test fails deterministically. This breaks storybook CI for **any** PR targeting `release/2.34` (e.g. the #27083 backport in #27144). `main` and `release/2.35` don't hit this because #25848 refactored the story there to forward only `values` to the spy; that refactor was never backported to 2.34. ### Fix Match the second argument with `expect.anything()` so the assertion reflects Formik's actual call signature. Test-only, minimal, no product code change. Verified on 2.34: `ProviderForm` storybook stories (13) pass; lint clean.
Base automatically changed from
fix/bedrock-provider-form-story-2.34
to
release/2.34
July 14, 2026 07:12
rowansmithau
requested review from
jakehwll and
mtojek
and removed request for
rowansmithau
July 16, 2026 02:20
jakehwll
approved these changes
Jul 16, 2026
mtojek
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #27083
Original PR: #27083 — fix(site): keep activity bump editable when allow_user_autostop is on
Merge commit: 1eea4a7
Requested by: @rowansmithau
Cherry-pick conflict resolution
The automatic cherry-pick of the merge commit (
-m1) conflicted because its diff pulled in the autostop reminder feature (AutostopReminderHelperText, the "Autostop reminder (hours)" field, andtime_til_autostop_notify_ms), which does not exist onrelease/2.34.Resolution: apply only PR #27083's actual change (the
allow_user_autostop/ activity-bump fix) and drop the unrelated autostop-reminder additions that the merge-commit diff dragged in.TTLHelperText.tsx: applied theActivityBumpHelperTextallowUserAutostopchange; did not addAutostopReminderHelperText.TemplateScheduleForm.tsx: applied the activity-bumpdisabledand submit changes; did not add the autostop-reminder field.TemplateSchedulePage.test.tsx: removed the three superseded activity-bump tests (auto-merged cleanly).TemplateSchedulePageView.stories.tsx: added the three activity-bump stories; dropped the autostop-reminder stories.Verified on 2.34:
TemplateSchedulePage.test.tsx(20 tests) and theTemplateSchedulePageViewstorybook interaction tests (6) pass; the changed files type-check and lint cleanly.