A pleasant walk through computing

Comment for me? Send an email. I might even update the post!

Scroll bars in Blogger <pre> Tags

EDIT

I just discovered the fix below only works in Chrome. Sigh. Poor testing on my part, but is this also poor work on Google’s? I am, after all, using Google’s own “prettify”! What will it take to have scrolling pre blocks???

===============

EDIT 2

Finally! Ignore the code in the main post, and use this.

http://stackoverflow.com/questions/13946182/scrollbars-for-code-prettified-using-google-code-prettify

pre {display:block; overflow:auto; width:auto; white-space:pre; word-wrap:normal;}
pre.prettyprint {background-color: aliceblue;}
pre.console {background-color: black; color: white;}

 

===== DON’T USE THIS CSS, BUT LEAVING HERE FOR HISTORICAL (HYSTERICAL) REASONS======

I guess I didn’t look hard enough. For well over a year, I accepted that my blog’s source code sections would always wrap. I put the code in a <pre class=”prettyprint”> tag, and I had added the following to my template.

image

overflow: auto is pretty standard stuff I’ve used before, and no one pointed me elsewhere. Finally, today, I found the answer on this Stack Overflow page.

http://stackoverflow.com/a/15639868

I needed to include overflow-wrap: normal.

pre.prettyprint {background-color: aliceblue; overflow:auto;overflow-wrap:normal;}
pre.console {background-color: black; color: white; padding: 5px; overflow:auto;overflow-wrap:normal;}

As you can see in the example below, it now adds the expected scroll bar.

  public class LongCode()
  {
    public void PrintLongCode()
    {
      Console.Write("This is some pretty long code that shouldn't wrap so that the reader isn't confused by unexpected line breaks.");
    }
  }

Google Keep Changes: Taking to the Forums

I’ve taken my own advice and posted on the Google Forums about their Keep change, which I previously outlined here.

http://www.softwaremeadows.com/2016/02/backward-step-for-google-keep.html

Here’s the forum link if you want to comment. Below the link is the full text.

Backward Step for Google Keep

Issue

Two settings that were previously per-list are now global to all lists:

* Move checked items to bottom

* Add new items to the bottom

This is a backward step for the product. Adding these to default settings, and retaining per-list settings, would be much better.

Use Cases - Move checked items to bottom

Different lists benefit from different behaviors. For example, in many people's To Do lists, they want completed items to be removed, either completely or by moving them to the bottom of the list. It's a dynamic list. By being on the list's bottom, tasks can reactivated/moved back up if necessary, and also be counted at the end of the day by people who like to see what they accomplished.

A grocery list, on the other hand, works better by keeping checked items where they are. It's a permanent, reusable list, with dozens of items and keeping them in order is critical.

With the latest settings change, users are forced to be inefficient with potentially half their lists. In many cases, the lists become unusable, leading users away from your product.

Use Cases - Add new items to bottom

The behavior of lists in Keep is that, when opened, they scroll to the "new item" entry. If the setting is "add to bottom," this means the bottom of the list is shown. This is a problem on, again, a list such as groceries, where users want to start at the top and work their way down. But this is appropriate for To Do lists where users may want the oldest items on top, and where the lists are often shorter.

Really, the scrolling behavior should be independent of where new items are added. But even if it were, some lists will work better putting new/recent items at the top (such as a journal) , while others are better with new items added to the bottom (such as a To Do).

Conclusion

These settings should remain per-list. Even if a minority of users change them, those are often the "power users" who depend on Keep and will switch to another tool, removing their valuable usage patterns from Google's database.

If there is a problem with user confusion, it can surely be solved through the user interface. 

At a list level, call it out:

In this list

Move checked items to bottom

Add new items to the bottom

In the global settings:

For new lists

Move checked items to bottom

Add new items to the bottom

Google Keep developers, I--and I'm sure others--urge you to return these important settings to us.

Backward Step for Google Keep

Google notified me yesterday they’d updated Keep, their note-taking application that I love to use. The update is that certain note settings are now applied to all lists. Among these:

  • Add new items to the bottom
  • Move checked items to the bottom

image

I think this is a step backward. While I’d have applauded these being default list behaviors, I don’t think they should be global. I’ve had several occasions where I want one list to move checked items to the bottom, and another to keep them where they are. Likewise with where new items are added.

I’m don’t why Google decided to remove a feature that was, as far as I knew, working fine.

Agree? Say so on the Google forums!