Journals are in 2.3 and they are awesome!

I have been hard at work on the next feature version of Ink Calendar. This version is bringing Journals, a feature which many users have requested for a while now. Unlike the other calendar views Journals do not have dates and are not tied to dates in any way. There are a few different styles to choose from and offer the flexibility to make Ink Calendar work for you!

Journal Builder Page
Bullet Journal and Graph paper backgrounds

The app has been submitted to the Microsoft Store now all I do is wait! As always thank you for using Ink Calendar and it brings me so much joy knowing people use this app every day!

Joe

What is next for Ink Calendar 2.3+

I have been working on bug fixes and planning the next slate of features for Ink Calendar.

New Features being planned and designed

  • More space for writing
  • Extra writing pages
  • Week numbers more places
  • Text on views
    • Clickable Hyperlinks
  • Surface more Custom Views
  • More?
    • Leave a comment or email me if you have another idea you’d like to see added!

Bugs or Issues being worked on

  • Appointment Management Bug in Windows
  • Use latest Microsoft Identity packages
  • Use WinUI 2.7
  • Improving defaults to be more of what people expect
  • Better explanations in the app
    • How Ink Calendar gets appointments
    • How to add or remove accounts
    • How to sync ink etc.
  • General bug fixes
    • Custom Views not updating when changing view settings
    • Reducing memory usage
    • More tests for different elements on the app
    • Better cloud sync error management

I hope Ink Calendar has been working well for you! Feel free to reach out if you have anything you’d like to share.

Joe

Windows’ AppointmentManager Bug

Windows has a bug when it comes to the AppointmentStore API. Somehow the AppointmentManager gets into a bad state which fails to acknowledge new appointments, and fails to provide updated appointment information. This means when adding an appointment Ink Calendar has no way of getting that new appointment data back from Windows 10.

How does this affect you?

When adding appointments to Ink Calendar they will not refresh or show up even when restarting the app. Ideally this is the worst case, but in some cases this bug results in Ink Calendar crashing.

What is being done about this?

I have made a separate app to demonstrate the several bugs within the AppointmentManger API but Microsoft has failed to acknowledge these bugs. When submitting a crash report through the Feedback Hub when this issues was being demonstrated Microsoft dismissed the feedback and did not provide guidance or any updates.

A post has been made to the Microsoft Q&A website on how to best “refresh” the AppointmentManager to stop getting stale data, but no progress has been made there.

What will happen?

It is unclear if this bug will ever get the attention required to be fixed. In the mean time Ink Calendar should work and not crash, but will occasionally have old calendar data. I have experienced this bug on Windows 11 as well, so the fix is not on the horizon as far as I can tell. I will continue working to find a solution, but in the mean time feel free to reach out to Microsoft, file feedback, and let the company know how this bug is affecting you.

Thanks for sticking with Ink Calendar through this pain. And if you have a fix for this bug please reach out, support at inkcalendar dot com, comment below, or tweet at me TheJoeFin.

Joe

Obsessing over bug fixes and performance

For the last several versions of Ink Calendar I have been focusing on fixing bugs. I am trying to do everything in my power to fix every single instance of crashing and performance issues. Watching every crash in AppCenter and doing what I can to understand and fix the root cause.

Stability ebbs and flows due to me rearchitecting the app to be more robust overall. One major source of crashes in the past month were related to me using a different system for triggering timers. This new system was the modern way of having reoccurring checks for new ink in the cloud and loading and syncing. I have since been able to refine my implementation and have seen crashes reduce significantly.

Another major area of focus has always been memory usage and the speed for views to load. With the next update (2.2.17) I’ll be rolling out a new cache method when switching between views. In my testing this new method is robust and reduces possible memory leaks from switching back and forth between views.

With any new addition like this the risk of bugs being introduced is high. However, the opposite is also very possible. Ideally with fewer objects hanging around in memory doing strange things Ink Calendar should be more stable. I test Ink Calendar on three devices in a variety of different ways. In addition to manual testing I write unit tests to ensure methods are robust and fault tolerant.

Hopefully you’ve stuck around over the years while I’ve been working on Ink Calendar. I want to believe the app has become a great app and delivers way more value to users. As always, I’m open to any feedback or suggestions. Just email support at inkcalendar dot com.

Joe

Roadblocks to Fixing Known Issues

Cover Photo by Ashkan Forouzani on Unsplash

I have been working on Ink Calendar since October 2017. Since then the app has grown to be much more capable and complex. When developing I expect there will be issues with my code, but as I have discovered there are also major issues with Windows APIs. In this post I plan to layout the issues I have been trying to fix for years with no success.

Ink Analysis Crash

One of the obvious hallmarks of Ink Calendar is the inking. Inking is different than traditional computer inputs like keyboard and mouse. A powerful inking experience requires quick selection and the ability to convert from ink to text. Lucky for me Microsoft makes this very easy with an API.

However this same magical API called InkAnalysis is the single biggest source of instability within Ink Calendar. My personal guess is this API is not heavily used because it has not improved or changed since I have been using it. Also Microsoft’s documentation on how to isolate the application from the InkAnalyzer does not exist. I have been working with the team to resolve issues; so far with no success.

Calendar API Errors

The other headline feature in Ink Calendar is the Calendar part. When users ink on a day and want to add that day to their Calendar in a more formal way there is a very easy API which can be called to add the appointment to the user’s calendar. However this API is frequently and randomly broken. No good feedback on a successfully added appointment. This means as a developer I have to guess if the appointment was added or the dialog was just canceled by the user.

Within the same AppointmentManager API is getting the user’s calendar appointments to show them on the calendar. This also is broken randomly and does not provide up-to-date appointment data. This completely prevents Ink Calendar from being able to provide a seamless calendar application. There is no clear way to connect with Microsoft regarding this issue and I have tried several different avenues.

Azure Pipelines

Building UWP apps and submitting them to the Microsoft Store should be the easiest Azure Pipeline that exists, but it is such a terrible experience there is no wonder UWP was never widely adopted. When users finally get pipelines working they randomly break with totally unhelpful error messages “internal compiler error.”

Does Microsoft Want UWP Developers to be Successful?

It doesn’t seem like it. When compared to other platforms like iOS and Android, UWP devs have no advocates within Microsoft. All of the recent developer and technology investments have been made last and worst for UWP experiences. Azure DevOps, AppCenter, C# language, .NET 5, are best when not developing a Windows GUI application. UWP is ignored and abandoned. Microsoft’s own 15 year old framework WPF has gotten more support than UWP.

I want to be an independent UWP developer, but as time goes on it becomes clear UWP is the bastard child of Microsoft.

Custom View Appointments and Bug Fixes

After releasing Ink Calendar 1.25.3 work began on bringing appointments to the custom views. No major issues were found with the custom views, but there have been nagging bugs within Ink Calendar which have been very difficult to understand what is happening. In addition to rewriting the appointment render logic I have been focusing on every error I see in Microsoft AppCenter.

Appointments

Adding appointments to custom views meant writing as a patchwork of controls which held the smallest size of a appointment canvas. For example the month view shows appointments for a single day, but multi-day appointments stretch over a single day. This means there needs to be a control which displays a week of days and overlays appointments correctly.

Fighting Bugs

With all new features there is the possibility of bugs and crashes. One of the more common crashes I was seeing after introducing Custom Views was “The added or subtracted value results in an un-representable DateTime.” It is unclear why or when this happens. I have several theories but none of them seem to remove this issue altogether.

The issue can be mitigated by making sure the DateTime isn’t of year 0 which would not work when adding a previous year. However maybe this issue happens because the ViewStateHistory list crashes due to File Access Violations. This is also unclear because the actual failure has nothing to do with the ViewStateHistory. What makes me think the ViewStateHistory could be involved is a blank ViewStateHistory could drive the main view constructor to start from a DateTime of 0,0,0.

All this to say bugs are tricky and the hardest part is finding what is failing. Hopefully 1.25.9 will bring an end to this bug and small improvements all over Ink Calendar. Thanks as always for reading.

Joe

The Custom Pen Gallery: part 3

Adding a new pen

Saving the pen gallery was not very complicated, but there were some unfortunate complexities. The major complexity was how to initiate a change to the pen gallery. The standard UWP InkToolbar does not provide any events relevant to if or when the user changes any of the tool’s drawing attributes.

When to save

Obviously Ink Calendar should save the Pen Gallery when the users adds a new pen, deletes a pen, or moves the location of a pen. However it is also important that changes to the pen’s properties get saved when they are changed.

The way I decided to trigger this save was on ink saving. This means when the user navigates or inks the SaveInk method runs and that would trigger the SaveCustomPens method to fire.

To keep Ink Calendar from saving the custom pen file every time ink was saved the beginning of the SaveCustomPens method checks to make sure there are changes to save. If there are changes then the current InkToolbar is converted into an array and saved to a .XML file.

Convert the InkToolbar into an array

Before the pen gallery can be saved to a file it is converted to a simple List<string[]>. This is done by iterating through each button and saving an entry in a new string array for the type of pen (ballpoint, highlighter, or pencil), the selected brush index, and the stroke width, and a Pen ID.

There is another method which takes the data from this type of array and adds InkToolbarCustomPen to the InkToolbar.

Saving the List to .XML

The next step was simple, pass the List<string[]> to a method which saves it to the app’s directory. DotNET has some very easy APIs for serializing data and saving it to a file.

public static async Task SaveCustomButtons(List<string[]> listToSave)
{
    StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("CustomToolButtons.xml", CreationCollisionOption.ReplaceExisting);
    XmlSerializer serializer = new XmlSerializer(typeof(List<string[]>));
    using (Stream fs = await file.OpenStreamForWriteAsync())
    {
        TextWriter textWriter = new StreamWriter(fs);
        serializer.Serialize(textWriter, listToSave);
    }
}

This is a sample method of how I save data throughout Ink Calendar. Right now the data generated by the app is fairly simple and low volume. Eventually Ink Calendar could grow to a point where it needs a SQLite database but for now .XML does the trick.

Thanks for reading and let me know if you have any questions or comments. Next I’ll talk about how I enabled the pen gallery to be edited on all form factors.

 

Joe

The Custom Pen Gallery: part 2

Adding a pen gallery was simple at first but I decided to add some more to the custom tool button. In my initial attempt I would initialize a new InktoolbarCustomPenButton and set its properties in code then add it to the Inktoolbar.

While this did work it left the issue of having two pens of the same type and color but different size and not being able to differentiate between them. So I decided to make a custom XAML control for custom pens, custom highlighters, and custom pens.

I started with a user control, but then just made a custom control of type InkToolbarCustomPenButton. I could customize the content of each of these controls to match the default inktoolbar buttons. To find these symbols I used the awesome app Character Map UWP by Edi Wang (Store Link HERE). I needed the tool outline, the tip and top color, and the background fill.

I bound the fill of the tip and top color to the SelectedBrush property of the InkToolbarCustomPenButton. Then I bound the background fill to the background of the InkToolbarCustomPenButton. This is so when the size shape is big enough it won’t make the tool icon look transparent.

17 Resize Pens

For the size representation, pen and pencil use an ellipse and highlighter uses a rectangle which the fill is bound to the SelectedBrush property and the height and width both bound to SelectedStrokeWidth. With oneway binding the shape would change color and size as the user adjusted the pen options.

Now when the users clicks “New Pen” an instance of my custom control is created and added to the inktoolbar. Simple. Users could add as many pens as they wish. They are in a scrollviewer so they can all be seen with a quick flick.

Next is the challenge of saving and loading this custom gallery each time the app loads.

Joe

The Custom Pen Gallery: Part 1

In UWP there is a control called the InkToolbar. This is a control which binds to an InkCanvas and is an easy way for users to change the type, size, and color of their inking. Ink Calendar has used this control from day one but now it is getting some attention.

The UWP version of OneNote has a pen gallery instead of the standard InkToolbar control. This enables users to set several pens and easily switch between them, without tediously changing each attribute every time. I wanted to bring the same experience to Ink Calendar because I found myself using a only few different pens while planning my time. One was a medium thickness gray pen for crossing out days. One was a thin blue pen for writing down appointments. And finally one was a highlighter for blocking out chunks of days.

There where four key elements to making my custom pen gallery in the InkToolbar.

  1. Custom Pens
  2. Custom Pen Button
  3. Saving the gallery
  4. Editing the gallery

To make this control I had to create custom pens for the Ballpoint Pen, Highlighter, and Pencil. You cannot add more than one standard tool to the InkToolbar, you must make them InkToolbarCustomToolButtons. Each type of InkToolbarCustomToolButton requires its own InkToolbarCustomPen to define how the ink will display when that tool is active.

protected override InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, double strokeWidth)
{
      InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes
      {
          PenTip = PenTipShape.Circle
      };
      SolidColorBrush solidColorBrush = brush as SolidColorBrush;
      inkDrawingAttributes.Color = solidColorBrush?.Color ?? Colors.Red;
      inkDrawingAttributes.DrawAsHighlighter = false;
      inkDrawingAttributes.Size = new Windows.Foundation.Size(strokeWidth * 0.5, strokeWidth * 0.5);
      return inkDrawingAttributes;
}

I made three custom pens: ballpoint pen, highlighter, and pencil. I could have chosen to make the highlighter tip shape round instead of rectangular like the standard InkToolbar highlighter, but I decided to keep it consistent to how it has been. I could still add a new pen like a highlighter but more of a marker with a round tip.

Once I had all the custom pens I needed I started working on the InkToolbarCustomToolButtons. These controls inherit from InkToolbarCustomPenButton which enables them to be added into an InkToolbar. These buttons started simple but I made them a little more complex than the standard.

Up next… the InkToolbarCustomPenButton XAML.

Joe