Skip to content

Show file name in browser tab title when viewing files#5896

Merged
unknwon merged 1 commit intogogs:mainfrom
GeorchW:patch-1
Jan 31, 2026
Merged

Show file name in browser tab title when viewing files#5896
unknwon merged 1 commit intogogs:mainfrom
GeorchW:patch-1

Conversation

@GeorchW
Copy link
Contributor

@GeorchW GeorchW commented Jan 4, 2020

I've just encountered the problem that when browsing multiple files in different tabs, the tab title does not show the file name, which makes browsing a repository a happy game of memory for the entire family. This PR takes the fun away and should just display the file name in the title.

@unknwon unknwon added the status: needs feedback Tell me more about it label Jan 22, 2020
@unknwon
Copy link
Member

unknwon commented Jan 22, 2020

Thanks for the PR!

But the CI is failing with some type error.

Copy link

@roberChen roberChen left a comment

Choose a reason for hiding this comment

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

Reason of type error of c.Data["Title"] = blob.Name() + " - " + c.Data["Title"]

return
}

c.Data["Title"] = blob.Name() + " - " + c.Data["Title"]
Copy link

@roberChen roberChen Mar 28, 2020

Choose a reason for hiding this comment

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

see macaron.Context.Data, the type is map[string]interface{}, the c.Data["Title"] should be change to string before adding other string variables.

@unknwon unknwon added status: needs followup and removed status: needs feedback Tell me more about it labels Mar 28, 2020
@unknwon unknwon changed the base branch from master to main August 27, 2020 11:29
@unknwon unknwon self-requested a review as a code owner December 4, 2025 05:58
Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

See previous comment.

@unknwon unknwon added this to the 0.14.0 milestone Jan 31, 2026
I've just encountered the problem that when browsing multiple files in different tabs, the tab title does not show the file name, which makes browsing a repository a happy game of memory for the entire family. This PR takes the fun away and should just display the file name in the title.
Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thank you!

@unknwon unknwon changed the title Show file name in window/tab title Show file name in browser tab title when viewing files Jan 31, 2026
@unknwon unknwon merged commit f70f29f into gogs:main Jan 31, 2026
11 checks passed
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (3650b32) to head (76222c5).
⚠️ Report is 189 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #5896       +/-   ##
==========================================
- Coverage   15.28%       0   -15.29%     
==========================================
  Files         106       0      -106     
  Lines       13864       0    -13864     
==========================================
- Hits         2119       0     -2119     
+ Misses      11465       0    -11465     
+ Partials      280       0      -280     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to 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.

3 participants