Skip to content

Preselect application locale and currency from .env during reinstallation - #515

Merged
navneetkumar-pim-webkul merged 2 commits into
unopim:masterfrom
mrprince-webkul:dev/search-installer-master
Jun 26, 2026
Merged

navneetkumar-pim-webkul merged 2 commits into
unopim:masterfrom
mrprince-webkul:dev/search-installer-master

Conversation

@mrprince-webkul

Copy link
Copy Markdown
Contributor

Problem

When re-running the installer on an existing instance, the locale and
currency prompts always opened empty — users had to reselect values that
were already configured in .env, risking accidental changes.

Change

The installer now reads the existing APP_LOCALE / APP_CURRENCY from .env and
shows them as the preselected option. Press Enter to keep the current
value, or Backspace to clear and search for a different one. Search behavior
is unchanged.

  • New PreselectedSearchPrompt (extends Laravel Prompts' SearchPrompt) —
    seeds the current value as the highlighted default; reverts to normal search
    on any keypress.
  • updateEnvChoice() now resolves the existing .env value via
    getEnvChoiceDefault() and passes it as the default.
  • Missing/stale values fall back gracefully to an empty prompt (no crash).

Tests

Added InstallerPreselectEnvChoiceTest covering: keep-on-Enter,
change-via-Backspace, no-default, invalid/stale value, and .env resolution.
Verified end-to-end against the real updateEnvChoice flow.

@rajpratham1 rajpratham1 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.

This is a thoughtful UX improvement that solves a genuine usability issue during reinstallation without changing the existing search behavior. The implementation is well scoped, gracefully handles invalid or missing .env values, and is backed by comprehensive tests covering both the prompt behavior and environment value resolution.

@navneetkumar-pim-webkul
navneetkumar-pim-webkul merged commit 34e16d7 into unopim:master Jun 26, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants