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
6 changes: 3 additions & 3 deletions Cotabby/Support/SuggestionSettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ struct SuggestionSettingsStore {
/// Duration in seconds of the suggestion fade-in ramp, surfaced as a Slow-to-Fast speed slider.
/// The band is narrow on purpose: below the floor the ramp is imperceptible (reads as an instant
/// snap), and above the ceiling the ghost text feels like it lags the caret rather than settling
/// in at it. 0.10s maps to the second-fastest slider tick: quick enough to feel responsive while
/// leaving one faster step for users who want a nearly instant appearance. Lower is a faster fade.
/// in at it. 0.05s is the fastest slider tick, so new installs get the most responsive fade
/// while users can still choose a slower transition. Lower is a faster fade.
static let minimumFadeInDuration: Double = 0.05
static let maximumFadeInDuration: Double = 0.30
static let defaultFadeInDuration: Double = 0.10
static let defaultFadeInDuration: Double = 0.05
static let fadeInDurationStep: Double = 0.05

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.

P1 Reset Keeps Stale Duration

When a user already has cotabbyFadeInDurationSeconds persisted at the old 0.10 value, reset-to-defaults does not remove that key, so load() keeps reading the stale value instead of this new 0.05 default. The visible result is that resetting Appearance settings can leave the fade speed on the old second-fastest tick instead of the new fastest default.

Fix in Codex Fix in Claude Code


/// Hard upper bound on the persisted Extended Context blob, in characters. Sized to match what the
Expand Down
10 changes: 5 additions & 5 deletions CotabbyTests/SuggestionSettingsStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,19 @@ final class SuggestionSettingsStoreTests: XCTestCase {
XCTAssertTrue(data.fadeInSuggestions)
}

func test_load_fadeInDurationDefaultsToSecondFastestTick() async {
func test_load_fadeInDurationDefaultsToFastestTick() async {
let defaults = makeIsolatedDefaults()

let data = SuggestionSettingsStore(userDefaults: defaults).load(configuration: .standard)

// The UI reflects duration across the slider range, so 0.10s maps to speed-axis 0.25:
// the second-fastest tick in the 0.05...0.30 band shown in Appearance settings.
XCTAssertEqual(SuggestionSettingsStore.defaultFadeInDuration, 0.10, accuracy: 0.0001)
// The UI reflects duration across the slider range, so the shortest 0.05s duration maps
// to speed-axis 0.30: the rightmost, fastest tick in Appearance settings.
XCTAssertEqual(SuggestionSettingsStore.defaultFadeInDuration, 0.05, accuracy: 0.0001)
XCTAssertEqual(
SuggestionSettingsStore.minimumFadeInDuration
+ SuggestionSettingsStore.maximumFadeInDuration
- SuggestionSettingsStore.defaultFadeInDuration,
0.25,
0.30,
accuracy: 0.0001
)
XCTAssertEqual(
Expand Down
Loading