Mailspring/static/components/editable-list.less
Ben Gotow 606909e256 feat(mail-rules): Per-account mail rules filter incoming, existing mail
Summary:
Originally, this was going to be a totally independent package, but
I wasn't able to isolate the functionality and get it tied in to
the delta-stream consumption. Here's how it currently works:

- The preferences package has a new tab which allows you to edit
  mail filters. Filters are saved in a new core store, and a new
  stock component (ScenarioEditor) renders the editor. The editor
  takes a set of templates that define a value space, and outputs
  a valid set of values.

- A new MailFilterProcessor takes messages and creates tasks to
  apply the actions from the MailFiltersStore.

- The worker-sync package now uses the MailFilterProcessor to
  apply filters /before/ it calls didPassivelyReceiveNewModels,
  so filtrs are applied before any notifications are created.

- A new task, ReprocessMailFiltersTask allows you to run filters
  on all of your existing mail. It leverages the existing TaskQueue
  architecture to: a) resume where it left off if you quit midway,
  b) be queryable (for status) from all windows and c) cancelable.
  The TaskQueue is a bit strange because it runs performLocal and
  performRemote very differently, and I had to use `performRemote`.
  (todo refactor soon.)

This diff also changes the EditableList a bit to behave like a
controlled component and render focused / unfocused states.

Test Plan: Run tests, only for actual filter processing atm.

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2379
2015-12-23 02:19:32 -05:00

101 lines
2.3 KiB
Plaintext

@import "ui-variables";
.nylas-editable-list {
.items-wrapper .selected.editing,
&:focus .items-wrapper .selected {
color: @component-active-bg;
background-color: @component-active-color;
}
.items-wrapper {
display: flex;
flex-direction: column;
border: 1px solid @border-secondary-bg;
background-color: @background-primary;
height: 90px;
font-size: 0.9em;
.selected {
background-color: fade(desaturate(@component-active-color, 100%), 70%);
color: @component-active-bg;
}
.edit-icon {
display: none;
cursor: pointer;
}
.editable-item {
padding: (@padding-small-vertical - 1) @padding-small-horizontal;
cursor: default;
border-bottom: 1px solid @border-color-divider;
flex-shrink: 0;
&.selected.with-edit-icon {
display: flex;
align-items: center;
padding-right: 20px;
img.edit-icon {
display: inline;
background-color: @component-active-bg;
margin-left: auto;
}
}
&>input {
border: none;
padding: 0;
color: @component-active-bg;
background: transparent;
font-size: inherit;
line-height: 1.5;
}
::-webkit-input-placeholder {
color: @text-color-inverse-very-subtle;
}
}
.create-item-input {
&>input {
padding: (@padding-small-vertical - 1) @padding-small-horizontal;
border: none;
border-bottom: 1px solid @border-color-divider;
font-size: inherit;
}
::-webkit-input-placeholder {
font-style: italic;
}
}
}
.buttons-wrapper {
display: flex;
border: 1px solid @border-secondary-bg;
border-top: none;
background-color: @background-secondary;
.btn-editable-list {
display: flex;
justify-content: center;
height: 25px;
width: 25px;
border-right: 1px solid @border-secondary-bg;
font-size: 1em;
cursor: default;
color: @text-color-subtle;
&.btn-disabled {
background-color: transparent;
opacity: 0.4;
}
&:active {
cursor: default;
background-color: darken(@btn-default-bg-color, 9%);
box-shadow: inset 0 1px 0.5px rgba(0, 0, 0, 0.21);
}
}
}
}