This project is mirrored from https://*****@github.com/d-e-s-o/notnow.git. Updated .
  1. 31 Mar, 2019 1 commit
    • Daniel Müller's avatar
      Bump version to 0.2.0 · 6ad6402d
      Daniel Müller authored
      This change bumps the version of the crate to 0.2.0. The following
      notable changes have been made since 0.1.5:
      - Save and restore selected tab
      - Save and restore selected task on each tab
      - Support all libreadline supported keys when readline feature is
        enabled
      - Automatically create configuration directory instead of potentially
        failing save operation
      - Further decreased binary size by using system allocator
      - Bumped gui dependency to 0.3
      - Bumped rline dependency to 0.2
      6ad6402d
  2. 09 Mar, 2019 3 commits
    • Daniel Müller's avatar
      Feed raw input data to libreadline · a98f8fd0
      Daniel Müller authored
      In the past we were forced to convert a Key event as we received it
      through the UI back into a byte sequence that libreadline could
      understand. For common printable ASCII characters that is typically not
      a huge problem, but for escape sequences which can easily be terminal
      specific, that is a very big deal. Because we have no interest in
      translating every possible key back, we ended up just supporting a very
      basic set: backspace, delete, and escape.
      Now that the gui crate supports arbitrary event types, we are using an
      event type that contains the raw input data as handled by termion. With
      this patch we use this raw input data and feed it to libreadline. Doing
      so we can remove the cumbersome reverse translation logic.
      a98f8fd0
    • Daniel Müller's avatar
      Keep raw key event data around · 4a0a2fcc
      Daniel Müller authored
      As it stands the readline support is somewhat fudged on top of the other
      existing functionality. One manifestation of this lack of integration is
      that we work with already parsed keys everywhere throughout the program.
      Because libreadline requires the raw key input to work properly (which
      is dependent on the terminal emulator), we would effectively have to
      reverse the conversion to Key objects (from data as read from the input
      stream) as performed by termion. Naturally, that is not something we
      want to do.
      To achieve proper integration nevertheless, this change instead takes
      care of storing the raw input data along with the key object. This is
      only a first step. A next step will have to adjust the UI code to work
      with this raw data.
      4a0a2fcc
    • Daniel Müller's avatar
      Simplify common creation of Event objects · b348d7ad
      Daniel Müller authored
      The majority of the UI tests use the Event type in one form or another.
      A common task is to create an event representing a particular key to
      send it to the UI.
      Given how many tests perform such an action, it makes sense to simplify
      the creation of such Event objects. Hence, with this change we introduce
      additional From conversion for this type that shorten the construction
      from characters, bytes, and keys.
      b348d7ad
  3. 03 Mar, 2019 1 commit
    • Daniel Müller's avatar
      Update gui crate to 0.3 · ebbc50f7
      Daniel Müller authored
      This change bumps the gui crate version we consume to 0.3. The main
      change in this new version (and contributor to most of the changes made
      by this patch) is that widgets as defined by this crate no longer work
      with a predefined event type. Instead, they are fully generic over the
      event type to use.
      For this crate, this means that we now define our own event type, which
      just wraps a termion key. That in turn means that we can remove the
      translation logic which we used to convert a termion event into a gui
      specific one.
      Furthermore, the signatures of a few methods changed in incompatible
      ways, the users of which we adjust accordingly.
      ebbc50f7
  4. 31 Mar, 2019 2 commits
    • Daniel Müller's avatar
      Introduce ui module · 966f1b95
      Daniel Müller authored
      This change introduces a new module comprising the UI related bits and
      pieces, ui. Having a more fine granular modularization will hopefully
      help in keeping the architecture clean.
      966f1b95
    • Daniel Müller's avatar
      Persist currently selected task for each tab · 79c30d13
      Daniel Müller authored
      After having taking care of saving and loading the selected tab in the
      TabBar widget, this change also persists the selected task on each tab.
      79c30d13
  5. 26 Feb, 2019 2 commits
    • Daniel Müller's avatar
      Persist the currently selected tab · d3b7996c
      Daniel Müller authored
      So far the main UI state we have preserved are the queries backing up
      the individual tabs in the TabBar. With this change we add persistence
      for another property to the program: the currently selected tab.
      d3b7996c
    • Daniel Müller's avatar
      Gather UI state from individual widgets · cb8640ba
      Daniel Müller authored
      This change completely reworks how we handle the UI state, the most
      important objective being that we now gather all the state on demand in
      order to persist it to a file, instead of keeping it in a centralized
      location to being with.
      In general that makes the design more natural (no more cloning of
      queries; only a single source of truth for them) and it was determined
      that this refactoring is a requirement to persist more parts of the UI
      (such as the currently active tab as well as the selected task), but
      gathering all this data is not the most straight forward process in our
      componentized system.
      Right now (in order to preserve the status quo in terms of what is being
      persisted) we mainly have to gather the queries used in the individual
      tabs. In order to accomplish that, we use an event together with the
      iteration logic we already employ for the search feature.
      cb8640ba
  6. 25 Feb, 2019 1 commit
    • Daniel Müller's avatar
      Make UiState a publicly deconstructible wrapper · c2e9a1a6
      Daniel Müller authored
      As it stands the UiState struct is an actual "class" with internal
      state. We are moving towards a scheme where the UI's state is
      distributed over its constituent parts, and not centralized in a single
      object. In such a design the UiState is a mere container used for
      grouping and passing around related state, but there is no reason for
      secrecy or anything of that sort -- the members should be freely
      accessible.
      With this patch we make the UiState's members public to allow for easy
      deconstruction.
      c2e9a1a6
  7. 24 Feb, 2019 4 commits
    • Daniel Müller's avatar
      Remove no longer used duplicate_associated_type_bindings lint · cede9528
      Daniel Müller authored
      The duplicate_associated_type_bindings lint seems to have been removed
      with the Rust 1.32 release.
      This change removes the lint from the program to prevent the newly
      introduced warning from being emitted.
      cede9528
    • Daniel Müller's avatar
      Rename SelectionState to IterationState · 03e62e8a
      Daniel Müller authored
      This change continues and concludes the renaming of the supposedly
      selection related functionality. It renames the remaining parts in the
      TabBar, the TaskListBox, and the TermUi.
      03e62e8a
    • Daniel Müller's avatar
      Rename Selection* to Iteration* · a0dc248a
      Daniel Müller authored
      The selection module came into being as part of the implementation of
      search support which would find a certain term on a given tab and select
      the tab (and task) containing it. The module itself, however, is a bit
      of a misnomer, as it does not really deal with selection per se. Rather,
      it is really only supporting the iteration over the various tabs in an
      event driven manner.
      To make this fact more explicit, this change renames the module and its
      member accordingly.
      a0dc248a
    • Daniel Müller's avatar
      Indicate response events through names with past tense · b4b0cfc9
      Daniel Müller authored
      The notion of a response event has so far been conveyed by a "Resp"
      suffix. That is not too visually appealing. With this change we instead
      use the past tense to indicate a response.
      b4b0cfc9
  8. 22 Feb, 2019 1 commit
    • Daniel Müller's avatar
      Ensure that directory to save state in exists · 196b968a
      Daniel Müller authored
      It was noticed that persisting the state may fail if the directory
      ~/.config/notnow/ (or whatever the respective XDG environment variable
      specifies) does not exist.
      Hence, with this change we make sure to create any missing directories
      before attempting to save any state.
      196b968a
  9. 29 Jan, 2019 1 commit
    • Daniel Müller's avatar
      Detect temp directory dynamically · 2cf2d526
      Daniel Müller authored
      We have hand rolled most of the temporary file logic ourselves, and part
      of that means that we need to name a directory to use for the temporary
      file. So far we have unconditionally assumed /tmp, but that is not a
      very portable choice.
      With this change we use std::env::temp_dir to deduce this directory
      instead.
      2cf2d526
  10. 23 Jan, 2019 1 commit
  11. 15 Jan, 2019 1 commit
    • Daniel Müller's avatar
      Update SPDX license identifier · 2c22cc29
      Daniel Müller authored
      With version 2.0rc2 of the SPDX license list the license identifier
      GPL-3.0+ has been deprecated in favor of GPL-3.0-or-later.
      This change adjusts the Cargo.toml file to use the new identifier.
      2c22cc29
  12. 28 Dec, 2018 1 commit
    • Daniel Müller's avatar
      Drop explicit dependency on serde_derive · 228ad972
      Daniel Müller authored
      With recent changes in serde the crate now re-exports the serde_derive
      macros we use, provided that the 'derive' feature is enabled.
      With this change we do exactly that and with that drop the explicit
      dependency on serde_derive.
      228ad972
  13. 07 Jan, 2019 1 commit
    • Daniel Müller's avatar
      Switch to using the system allocator · ed5fc3b9
      Daniel Müller authored
      In the past we have already taken a couple of steps to reduce the size
      of the final binary, arguing that binary size is the metric of most
      relevance for the program at hand.
      With that in mind, this change decreases the binary size further by
      swapping the default allocator we use (typically jemalloc) with the
      system allocator (which is malloc based on Unix systems). Given that we
      are not allocation sensitive, there is no point in wasting binary size
      on something that adds no value.
      This change decreases the binary size by another 324 KiB (for an already
      stripped release mode binary).
      ed5fc3b9
  14. 27 Dec, 2018 1 commit
    • Daniel Müller's avatar
      Bump version to 0.1.5 · c62f0d5e
      Daniel Müller authored
      This change bumps the version of the crate to 0.1.5. The following
      notable changes have been made since 0.1.4:
      - Fixed problem caused by input of multi-byte characters
        - They will from now on be ignored
      - Updated README to reflect goals more accurately and to depict key
        bindings
      - Adjusted program to use Rust Edition 2018
      - Enabled 'unused-results' lint
      - Enabled CI pipeline comprising building, testing, and linting of the
        project
      - Added badges indicating pipeline status, current crates.io published
        version of the crate, and minimum version of rustc required
      - Added categories to Cargo.toml
      c62f0d5e
  15. 26 Dec, 2018 2 commits
    • Daniel Müller's avatar
      Add badges for crates.io and minimum rustc version · 35ea2980
      Daniel Müller authored
      This change adds another two badges to the repository. The first simply
      lists the most recent version of the crate as published on crates.io.
      The second one states the minimum version of rustc that is required for
      building. We have recently switched to using Rust 2018 and with that we
      have a requirement for version 1.31 of the toolchain. In the future the
      hope is that now that we have a proper CI/CD pipeline based off of
      Docker images we should be able to build on past versions of Rust, even
      if they are not used during development.
      35ea2980
    • Daniel Müller's avatar
      Add gitlab-ci.yml configuration file · 27f7faf7
      Daniel Müller authored
      This change adds a configuration file for the Gitlab CI/CD pipeline to
      the repository. This file (directly or indirectly) controls the
      environment in which to build, what exactly to build, and is also used
      to run the test suite.
      With the pipeline in place the change also adds a badge indicating the
      status of the build on the project's front page.
      27f7faf7
  16. 16 Dec, 2018 1 commit
    • Daniel Müller's avatar
      Pass State object to TermUi constructor · 7977bada
      Daniel Müller authored
      This change continues the effort of refactoring state management with
      the eventual goal of persisting more program related state (and loading
      it upon startup). More specifically, this patch simplifies the way we
      pass the state from the main function to the UI, by using a combined
      State object as opposed to splitting it into the constituent parts.
      7977bada
  17. 12 Dec, 2018 1 commit
    • Daniel Müller's avatar
      Address a couple of clippy suggestions and suppress others · 8395a0b6
      Daniel Müller authored
      Now that clippy is finally shipping as part of the Rust distribution we
      use, we plan to use it more frequently. With this change we address the
      minor issues it pointed out and suppress a couple of others that appear
      to be pretty subjective (potentially in conflict with a certain code
      "style") or otherwise not very helpful.
      8395a0b6
  18. 09 Dec, 2018 1 commit
    • Daniel Müller's avatar
      Remove "allow" of deprecated clippy lints · 75351cee
      Daniel Müller authored
      Both the let_and_return and redundant_field_names have been deprecated
      and are enabled by default in recent clippy versions. With this change
      we remove the lints from the "allow" block.
      75351cee
  19. 08 Dec, 2018 4 commits
    • Daniel Müller's avatar
      Demote more lints to "warn" · dfb9a6ae
      Daniel Müller authored
      In the past we have removed the "warnings" lint from the deny group, as
      future changes of Rust may warn on more occasions (the usage of
      deprecated items being a popular one).
      However, there are more lints that may change in the future. It is not
      known whether an exact list exists and so with this change we use best
      judgment as to what lints to demote to "warn".
      dfb9a6ae
    • Daniel Müller's avatar
      Deny two more lints · 2ba37cf4
      Daniel Müller authored
      With this change we add two more lints to the 'deny' group. The lints
      are believed to be stable in the sense that future versions of Rust
      should not be stricter about their enforcement.
      2ba37cf4
    • Daniel Müller's avatar
      Avoid a couple unnecessary allocations · db7b202f
      Daniel Müller authored
      With the Rust Edition 2018 we have support for non-lexical lifetimes.
      With those, the borrow checker is better able to infer accurate
      lifetimes of bindings and does not only simply look at the containing
      scope.
      Because of that added intelligence we are able to save a few allocations
      there were necessary beforehand due to conflicting lifetimes.
      db7b202f
    • Daniel Müller's avatar
      Compile program with 2018 Edition of Rust · 37a77270
      Daniel Müller authored
      With the 1.31 release of Rust support for Edition 2018 has reached
      the stable tool chain.
      This change enables compilation based off of this new edition for the
      crate. Along with that we remove deprecated lints and adjust the way we
      import macros.
      37a77270
  20. 27 Nov, 2018 2 commits
    • Daniel Müller's avatar
      Reorder TaskState and UiState usages · 7341344c
      Daniel Müller authored
      The renaming of program state with UI state had another positive side
      effect: the lexicographic ordering of the two terms is changed. As we
      would very much like to express the dependency that the UI state has on
      the task state by having a consistent ordering in terms of usage of the
      two states throughout the program, this change in ordering is very much
      welcome.
      With this patch we adjust all clients of the two to deal with the task
      state before the UI state.
      7341344c
    • Daniel Müller's avatar
      Rename ProgState to UiState · a266b45e
      Daniel Müller authored
      The concept of "program state" was found to be named not optimally, as
      program state conceptually also comprises the task state. So for an
      outside person the distinction may not be clear.
      To alleviate this problem, this change proposes a different wording: UI
      state. In line with that it replaces the usage of ProgState (and
      similar) with UiState.
      a266b45e
  21. 26 Nov, 2018 1 commit
    • Daniel Müller's avatar
      Introduce separate struct for program and task state · 2b98ddab
      Daniel Müller authored
      So far we have managed the most of the application's state through a
      single object combining both the program state as well as the task
      state. We would like to move to a model where those two states are
      treated differently, because they are fundamentally different: while the
      task state is being mutated by the application, the program state is
      effectively reflected through the UI. As such, the latter should be
      decomposed and assimilated in the UI and not mutated on the fly like the
      task state.
      With this change we make this split more pronounced by creating two
      first class structs: TaskState represents the task state and ProgState
      represents the program (or UI) state. We still have a State struct but
      it is mainly used to express the dependency connecting the two during
      creation. Objects of this type are intended to be destructed into their
      constituent parts.
      2b98ddab
  22. 25 Nov, 2018 3 commits
    • Daniel Müller's avatar
      Remove Result return from TermUi::new() · fc08ea18
      Daniel Müller authored
      Upon its inception, the TermUi::new() constructor cleared the display
      using a write operation. This operation could fail and, hence, the
      constructor could fail as well. To report the error the constructor
      returned a Result.
      However, as part of a refactoring the clearing was moved into a
      different module. Because of that we no longer have any error return
      paths. With this change we remove the Result from the return type.
      fc08ea18
    • Daniel Müller's avatar
      Favor Vec::into_iter() method over drain() · bdf99dc1
      Daniel Müller authored
      In the past we have used the drain() method of the Vec struct. Because
      that method does not consume the object of interest, erroneous uses can
      occur and conceptually unnecessary mutable bindings are created. As it
      turns out the into_iter() method is what we were actually looking for,
      in that it consumes the object in question.
      This change adjusts the code to prefer the usage of Vec::into_iter()
      over Vec::drain().
      bdf99dc1
    • Daniel Müller's avatar
      Enable unused-results lint · 35c714f3
      Daniel Müller authored
      This change enables the unused-results lint which potentially helps
      catch bugs introduced by forgetting the evaluation of results. It
      appears unlikely that it will cause problems as Option and Result
      objects should already be tagged to require evaluation and those seem to
      be the more likely sources of trouble. Regardless, the enablement of
      this lint seems to be benign.
      35c714f3
  23. 24 Nov, 2018 3 commits
    • Daniel Müller's avatar
      Update README to document usage information and key bindings · eb953210
      Daniel Müller authored
      So far we have kept the program's documentation fairly low-profile, with
      only high-level details being documented. As the program is in a
      reasonable state and ready for use by users who only require simple
      local task editing functionality, this change documents key bindings and
      other usage related information to increase accessibility.
      eb953210
    • Daniel Müller's avatar
      Update README to reflect eventual goal of having CalDAV support · 195da451
      Daniel Müller authored
      Along with tag based query filtering, support for synchronizing tasks
      with a server speaking the CalDAV protocol has manifested as one of the
      program's goals.
      This change updates the README to explicitly state this goal.
      195da451
    • Daniel Müller's avatar
      Ignore multi-byte character input · 02ec6931
      Daniel Müller authored
      Our character handling logic, being based on Rust's String struct, is
      Unicode capable at its core. However, because we replace parts of said
      string and the indexing done as part of that is happening at the byte
      level (as opposed to the grapheme level), we may actually invalidate the
      string which is represented in UTF-8 encoding by violating character
      boundaries.
      Unfortunately, this is very problematic to fix. While the String struct
      not only supports byte-wise access but is also character aware, a
      character in Rust's terms may not necessarily constitute a character as
      the user would recognize it. Special characters such as tilde or grave
      accent "decorating" a vowel, for example, may be treated as a separate
      character.
      The only real solution to this problem comes in the form of the
      unicode_segmentation crate would actually allow us to honor grapheme
      boundaries. However, the effort to convert everything appears to be high
      and we would add another dependency for functionality that is rarely
      used. As such, we punt on that right now and just ignore all multi-byte
      characters all together, and, with that, prevent them from causing
      havoc. This may or may not be a temporary solution.
      02ec6931
  24. 04 Nov, 2018 1 commit
    • Daniel Müller's avatar
      Add Cargo.toml categories · 6f5dcbe4
      Daniel Müller authored
      For a while now Cargo has supported the specification of categories in
      the Cargo.toml file and crates.io will actually honor those categories
      and show case the crate in them.
      With this change we specify the two categories this crate is believed
      to fit in the best: 'command-line-utilities' and 'text-editors'.
      6f5dcbe4