Skip to content

feat: put env string next to 'npmx' - #657

Merged
danielroe merged 4 commits into
npmx-dev:mainfrom
shuuji3:feat/env-string
Feb 12, 2026
Merged

feat: put env string next to 'npmx'#657
danielroe merged 4 commits into
npmx-dev:mainfrom
shuuji3:feat/env-string

Conversation

@shuuji3

@shuuji3shuuji3 commented Feb 1, 2026

Copy link
Copy Markdown
Member

How about adding the env name ('dev', 'preview', 'canary', or 'alphe' (for 'release' env)) next to the "npmx" like Elk (https://main.elk.zone vs https://elk.zone) in addition to the footer?

The logo color is already different but sometimes not enough to distinguish (ref. https://discord.com/channels/1464542801676206113/1464544843740217455/1467534525218295889 😄)

We could drop "alpha" for production if it's preferable.

Closes#1135


Screenshot of home page with 'dev' string right next to 'npmx' nameScreenshot of home page with 'dev' string right next to 'npmx' name (light theme)Screenshot of home page with 'alpha' string right next to 'npmx' name (manually changed string to 'alpha' here, color is not for 'release')
Screenshot of header title with 'dev' stringScreenshot of header title with 'dev' string (light theme)Screenshot of header title with 'alpha' string (same)

@vercel

vercelBot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 12, 2026 8:59pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 12, 2026 8:59pm
npmx-lunariaIgnoredIgnoredFeb 12, 2026 8:59pm

Request Review

@serhalp

Copy link
Copy Markdown
Member

I like it. I wouldn't put anything for prod builds. and I wonder if it would be better in the header somewhere? next to the logo? otherwise this env flag only shows on the landing page and not on the search, compare, setting, etc. pages.

@danielroe

Copy link
Copy Markdown
Member

this is a nice idea. I think it needs a design tweak as italic monospace isn't the most attractive font - I'll take a look

@ghostdevv

Copy link
Copy Markdown
Member

rebased! updated ss (with blue enabled of course):

image

@coderabbitai

coderabbitaiBot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR reads env from useAppConfig().buildInfo in both AppHeader.vue and pages/index.vue and adds a UI badge near the "npmx" logo/title that displays "alpha" when env equals "release", otherwise displays the env value. Styling and layout around the logo/title are adjusted to accommodate the absolutely positioned badge. No control-flow or public API changes were introduced.

Possibly related issues

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1 | ❌ 1
❌ Failed checks (1 warning)
Check nameStatusExplanationResolution
Merge Conflict Detection⚠️ Warning❌ Merge conflicts detected (9 files):

⚔️ app/components/AppHeader.vue (content)
⚔️ app/pages/index.vue (content)
⚔️ i18n/locales/en.json (content)
⚔️ i18n/schema.json (content)
⚔️ lunaria/files/en-GB.json (content)
⚔️ lunaria/files/en-US.json (content)
⚔️ nuxt.config.ts (content)
⚔️ server/middleware/canonical-redirects.global.ts (content)
⚔️ test/nuxt/a11y.spec.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (1 passed)
Check nameStatusExplanation
Description check✅ PassedThe PR description clearly explains the feature: adding environment labels ('dev', 'preview', 'canary', 'alpha') next to the 'npmx' logo, with rationale and supporting screenshots.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feat/env-string
  • Post resolved changes as copyable diffs in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/pages/index.vue (2)

25-25: No guard against missing env value.

If buildInfo or env is undefined (e.g. during local dev or a misconfigured build), destructuring will silently yield undefined, and the <sup> on line 57 will render an empty but still-visible element. Consider a fallback or a v-if guard on the <sup>.

Also, this ternary (env === 'release' ? 'alpha' : env) is duplicated verbatim in AppHeader.vue. Extract a small computed or utility (e.g. useEnvLabel()) to keep the mapping in one place.

Proposed: extract shared helper and guard rendering

For example, create a composable like composables/useEnvLabel.ts:

exportfunctionuseEnvLabel(){const{ env }=useAppConfig().buildInfoconstenvLabel=computed(()=>{if(!env||env==='production')returnundefinedreturnenv==='release' ? 'alpha' : env})return{ envLabel }}

Then in both templates, use it with a v-if:

- <sup class="text-3xl italic text-fg-muted">{{ env === 'release' ? 'alpha' : env }}</sup>+ <sup v-if="envLabel" class="text-3xl italic text-fg-muted">{{ envLabel }}</sup>

57-57: The text-3xl size feels oversized for a superscript badge.

On the index page this renders at text-3xl whereas AppHeader.vue uses text-sm. The visual weight difference is intentional (hero vs header), but text-3xl for a <sup> is quite large — danielroe's review comment also flagged the styling. Worth a second look at sizing/font choice here.

Comment threadapp/components/AppHeader.vue Outdated
@codecov

codecovBot commented Feb 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
app/pages/index.vue0.00%2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@essenmitsosse

essenmitsosse commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Yeah this is a great idea! Definitely solves a real issue! ❤️

@shuuji3

Copy link
Copy Markdown
MemberAuthor

Maybe we could show only 'dev' and 'preview' for now until we come up with better design so that we can reduce development friction?

@shuuji3

shuuji3 commented Feb 7, 2026

Copy link
Copy Markdown
MemberAuthor

I removed 'alpha' and created the issue for better desgin #1135.

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

Actionable comments posted: 1

Comment threadapp/pages/index.vue

@danielroedanielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

perfect!

@danielroe
danielroe added this pull request to the merge queueFeb 12, 2026
Merged via the queue into npmx-dev:main with commit 3faaf04Feb 12, 2026
18 checks passed
@shuuji3
shuuji3 deleted the feat/env-string branch February 12, 2026 23:01
@alexdln

alexdln commented Feb 12, 2026

Copy link
Copy Markdown
Member

@shuuji3 Thanks for the implementation and the idea ❤️

I adjusted the styles a bit to improve a bit general view on different devices, if you have any other UI ideas, feel free to ping me, I'll be happy to discuss and help

@shuuji3

shuuji3 commented Feb 13, 2026

Copy link
Copy Markdown
MemberAuthor

@alexdln Thanks, it looks good to me! I like colorizing it with accent colors 🎨

This was referenced Feb 28, 2026
Sign up for freeto 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.

Better design for env styling

6 participants

@shuuji3@serhalp@danielroe@ghostdevv@essenmitsosse@alexdln