Skip to content

Commit

Permalink
Introduce new TreeView UI component
Browse files Browse the repository at this point in the history
Key highlights:

- Written from scratch to cater specifically to privacy.sexy's
  needs and requirements.
- The visual look mimics the previous component with minimal changes,
  but its internal code is completely rewritten.
- Lays groundwork for future functionalities like the "expand all"
  button a flat view mode as discussed in #158.
- Facilitates the transition to Vue 3 by omitting the Vue 2.0 dependent
  `liquour-tree` as part of #230.

Improvements and features:

- Caching for quicker node queries.
- Gradual rendering of nodes that introduces a noticable boost in
  performance, particularly during search/filtering.
  - `TreeView` solely governs the check states of branch nodes.

Changes:

- Keyboard interactions now alter the background color to highlight the
  focused item. Previously, it was changing the color of the text.
- Better state management with clear separation of concerns:
  - `TreeView` exclusively manages indeterminate states.
  - `TreeView` solely governs the check states of branch nodes.
  - Introduce transaction pattern to update state in batches to minimize
    amount of events handled.
- Improve keyboard focus, style background instead of foreground. Use
  hover/touch color on keyboard focus.
- `SelectableTree` has been removed. Instead, `TreeView` is now directly
  integrated with `ScriptsTree`.
- `ScriptsTree` has been refactored to incorporate hooks for clearer
  code and separation of duties.
- Adopt Vue-idiomatic bindings instead of keeping a reference of the
  tree component.
- Simplify and change filter event management.
- Abandon global styles in favor of class-scoped styles.
- Use global mixins with descriptive names to clarify indended
  functionality.
  • Loading branch information
undergroundwires committed Sep 9, 2023
1 parent 821cc62 commit 65f121c
Show file tree
Hide file tree
Showing 120 changed files with 4,537 additions and 1,203 deletions.
9 changes: 8 additions & 1 deletion docs/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ Shared components include:

Desktop builds uses `electron-vite` to bundle the code, and `electron-builder` to build and publish the packages.

## Sass naming convention
## Styles

### Style location

- **Global styles**: The [`assets/styles/`](#structure) directory is reserved for styles that have a broader scope, affecting multiple components or entire layouts. They are generic and should not be tightly coupled to a specific component's functionality.
- **Component-specific styles**: Styles closely tied to a particular component's functionality or appearance should reside near the component they are used by. This makes it easier to locate and modify styles when working on a specific component.

### Sass naming convention

- Use lowercase for variables/functions/mixins, e.g.:
- Variable: `$variable: value;`
Expand Down
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"cross-fetch": "^4.0.0",
"electron-progressbar": "^2.1.0",
"file-saver": "^2.0.5",
"liquor-tree": "^0.2.70",
"markdown-it": "^13.0.1",
"npm": "^9.8.1",
"v-tooltip": "2.1.3",
Expand Down
8 changes: 7 additions & 1 deletion src/presentation/assets/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@
transform: translateY($offset-upward);
}
}
}
}

@mixin reset-ul {
margin: 0;
padding: 0;
list-style: none;
}
1 change: 0 additions & 1 deletion src/presentation/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
@forward "./components/card";

@forward "./third-party-extensions/tooltip.scss";
@forward "./third-party-extensions/tree.scss";
62 changes: 0 additions & 62 deletions src/presentation/assets/styles/third-party-extensions/_tree.scss

This file was deleted.

2 changes: 0 additions & 2 deletions src/presentation/bootstrapping/ApplicationBootstrapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { TreeBootstrapper } from './Modules/TreeBootstrapper';
import { IconBootstrapper } from './Modules/IconBootstrapper';
import { VueConstructor, IVueBootstrapper } from './IVueBootstrapper';
import { VueBootstrapper } from './Modules/VueBootstrapper';
Expand All @@ -17,7 +16,6 @@ export class ApplicationBootstrapper implements IVueBootstrapper {
private static getAllBootstrappers(): IVueBootstrapper[] {
return [
new IconBootstrapper(),
new TreeBootstrapper(),
new VueBootstrapper(),
new TooltipBootstrapper(),
new RuntimeSanityValidator(),
Expand Down
8 changes: 0 additions & 8 deletions src/presentation/bootstrapping/Modules/TreeBootstrapper.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/presentation/components/Code/TheCodeArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default defineComponent({
function handleCodeChange(event: ICodeChangedEvent) {
removeCurrentHighlighting();
updateCode(event.code, currentState.value.collection.scripting.language);
editor.setValue(event.code, 1);
if (event.addedScripts?.length > 0) {
reactToChanges(event, event.addedScripts);
} else if (event.changedScripts?.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
inject,
} from 'vue';
import { InjectionKeys } from '@/presentation/injectionSymbols';
import ScriptsTree from '@/presentation/components/Scripts/View/ScriptsTree/ScriptsTree.vue';
import ScriptsTree from '@/presentation/components/Scripts/View/Tree/ScriptsTree.vue';
import { sleep } from '@/infrastructure/Threading/AsyncSleep';
export default defineComponent({
Expand Down
173 changes: 0 additions & 173 deletions src/presentation/components/Scripts/View/ScriptsTree/ScriptsTree.vue

This file was deleted.

This file was deleted.

Loading

0 comments on commit 65f121c

Please sign in to comment.