Edgewall Software
Modify

Ticket #7759 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

Adding name of source file to the title bar

Reported by: jnlc32@… Owned by: Guy Rozendorn <guy@…>
Priority: normal Milestone: 0.12
Component: version control/browser Version: 0.11
Severity: minor Keywords: bitesized
Cc:
Release Notes:
API Changes:

Description

Usually when developing we open up multiple tabs.

In the titlebar it currently shows

/src/project/.../hello.c

This optional preference or default would be nice

hello.c - /src/project/.../hello.c

So I'm not looking at all these tabs that say /src

Version is: 0.11b2

Attachments

browser.patch (909 bytes) - added by Guy Rozendorn 2 years ago.
suggested patch for browser.py, to add the 'path_links[-1]' to the page title, if exists
browser.2.patch (953 bytes) - added by Guy Rozendorn 2 years ago.
attachment.patch (932 bytes) - added by guy@… 2 years ago.
patch for attachment page title

Download all attachments as: .zip

Change History

comment:1 Changed 3 years ago by cboos

  • Component changed from general to version control/browser
  • Milestone set to 0.11.3
  • Owner set to cboos
  • Severity changed from normal to minor

That will work as long as you have only a few tabs opened... I usually only see the favicons for my tabs ;-)

Nevertheless, I think it's a nice suggestion.

comment:2 Changed 3 years ago by cboos

Somewhat related: attachment preview pages have only "Attachment" for title. That could instead show the filename as well (e.g. the_fix.patch / #123).

For browser pages we could have something like "attachment.py in trunk/trac".

comment:3 Changed 2 years ago by rblank

  • Keywords bitesized added

Changed 2 years ago by Guy Rozendorn

suggested patch for browser.py, to add the 'path_links[-1]' to the page title, if exists

comment:4 Changed 2 years ago by Guy Rozendorn

The patch I just added puts on the page title either '/' or the full path if is short, or the '%1 - %2' where %1 is the last element in the path and %2 is the full path

comment:5 Changed 2 years ago by rblank

That's a good start. A few comments:

  • We always leave spaces around operators, so len(path_links)==1 should be written len(path_links) == 1.
  • We support Python down to 2.4 on trunk, so the ternary operator ... if ... else ... is not available. You can often get the same result with ... and ... or ..., but in this case, maybe it would be more readable to use py:choose on the <title> tag:
    <title py:choose="len(path_links)">
      <py:when test="1">${...}</py:when>
      <py:when test="2">${...}</py:when>
      <py:otherwise>${...}<py:otherwise>
    </title>
    

Changed 2 years ago by Guy Rozendorn

comment:6 Changed 2 years ago by Guy Rozendorn

cool. how's that?

comment:7 Changed 2 years ago by cboos

Better :-) Use path_links[1:], as we don't need "source:" in the title.

comment:8 follow-up: Changed 2 years ago by rblank

Patch applied in [9235]. Waiting for the corresponding attachment change.

One minor thing: currently we display "$base - $dir/$base". Should we rather use "$base - $dir" instead?

Changed 2 years ago by guy@…

patch for attachment page title

comment:9 Changed 2 years ago by anonymous

just attached suggested patch for the attachment title page.

comment:10 in reply to: ↑ 8 ; follow-up: Changed 2 years ago by cboos

Replying to rblank:

Patch applied in [9235].

Did you really intend to keep source:/...?

Should we rather use "$base - $dir" instead?

I also think so.

comment:11 in reply to: ↑ 10 Changed 2 years ago by rblank

Replying to cboos:

Did you really intend to keep source:/...?

No, and it's not present in the changeset :)

Should we rather use "$base - $dir" instead?

I also think so.

Ok, I'll fix that.

comment:12 Changed 2 years ago by rblank

  • Milestone changed from next-minor-0.12.x to 0.12
  • Resolution set to fixed
  • Status changed from new to closed

Attachment patch applied in [9238] with minor modifications:

  • Moved the parent assignment to the <head> tag, as we also use it in the body.
  • Fixed the indentation within the <title> tag (we use 2 spaces per level).
  • Use "{name} on {parent}" for the title, and added the required translation marker.

I also fixed the title for the browser to show "{base} in {dir}", again with a translation marker.

comment:13 Changed 2 years ago by rblank

  • Owner changed from cboos to Guy Rozendorn <guy@…>
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from Guy Rozendorn <guy@…>. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.