showInfobar setting is ignored (config reads "showInfo" instead)

Open Beginner friendly
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start with src/config.ts and inspect sanitizeConfig() and the legacy info migration; the issue identifies both incorrect keys and gives the suggested behavior. Run the reported sanitizeConfig() and fromQuery() cases for JSON, URL, legacy values, and unset defaults. Done when each case preserves the expected show or hide setting, including configs using the showInfo workaround.

Written by the indexing model from the issue text.

Description

Problem

"showInfobar": false in wall-config.json (or a ?load= config) has no effect; the info bar is always shown. The same happens with ?info=false in the URL and the "Show info bar" checkbox in the Customize dialog.

Cause

In src/config.ts, sanitizeConfig() reads the wrong key:

result.showInfobar = boolOr(config.showInfo, fallback.showInfobar)

config.showInfo is never set (the type, the URL parser and the generated config all use showInfobar), so it always falls back to the default (true).

A related typo in the legacy migration sets config.showinfo (lowercase), so the old info: "top"/"hide" values are ignored too.

Workaround for now: use "showInfo": false in the JSON config.

Suggested fix
     if (isString(config.info))
-        config.showinfo = config.info == "top"
+        config.showInfobar ??= config.info == "top"
...
-    result.showInfobar = boolOr(config.showInfo, fallback.showInfobar)
+    result.showInfobar = boolOr(config.showInfobar ?? config.showInfo, fallback.showInfobar)

Keeping ?? config.showInfo means configs that already use the workaround keep working.

Tested by running sanitizeConfig() / fromQuery() from current main (b55d81c) with Node: before the fix, {showInfobar: false} and info=false both give true; after it, every case (JSON true/false, URL true/false, legacy "top"/"hide", unset → default) gives the expected value.

Dominant language
TypeScript
Stars
95
Forks
10
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from defnull/fediwall

All issues in defnull/fediwall

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.