Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation #2

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Initial implementation #2

merged 3 commits into from
Mar 6, 2024

Conversation

kang-sw
Copy link
Owner

@kang-sw kang-sw commented Mar 3, 2024

Closes #1


  • Generic command system for Undo/Redo
  • Cell show/hide/reorder by drag-n-drop
    • Sort by column (invalidation)
  • Cell insertion/removal by hotkey / context menu.
  • Select cells: One-by-one, Drag, Hotkey, Headers
    • Duplication: From multiple selection, implement quick dup(ctrl+D) + smart dup(ctrl+E)
    • Clipboard: copy highlight row to clipboard, then paste it to selected cells
      • Note that copy is row-wise, paste is cell-wise
    • ❓ Kinda global clipboard -> paste between different row types.
  • Double click or press Enter to start editing selected cell (row)
    • When editing started, current row value is cached to create undo later.
    • User will cancel editing with escape key; which rollbacks the row data.

Issue: Table and inner widget interactivity

Seems egui PR emilk/egui#2244 blocks interaction of underlying table column widgets when table interaction is enabled. To address this issue, currently separated window is created upon table area to activate 'editor view', which is not desirable.

This seems comes from(not bug) egui_extras::Layout::add method that is invoked by TableRow::col. _::Layout::add calls self.cell(.., add_cell_contents) before calling into self.ui.allocate_rect for retrieving cell interaction, which simply covers interaction area of user-requested ui from add_cell_contents.

Prior to egui 0.20(from mentioned PR), it was just okay since there were no input priority between widgets within same area. However, afther the PR, it seems widget interaction now have kinda 'latest first' priority, which prevents passing-through user interactions.

However, I don't know why the egui web demo page works with this well; perhaps its version is less than 0.20? Otherwise, it'll be my setup issue? Should be tested with wasm32 build either...

@kang-sw kang-sw changed the title Implement #1 Initial implementation Mar 3, 2024
[wip] add type-safety on various indices

[wip] editor widget

constrain editing widget to table body

improve active ui rendering

improve active row edit size handling

improve window rect layout

change selection to use visual coords

Extract rendering logics to separate class

[wip] command system

extract body display method

implement visual repr of temporary selection

[wip] hotkey handling

change cursor state-machine based

verify undo/redo/hotkeys

[wip] changing to cell based edition

- User should not care about which column should be editted
- Columns may change at any time.
- Therefore, cell based edition is appropriate.

[wip]

implement basic edition

fix remained garbage on focus movement

add dirty flag field on sheet

fix cci_selection rendering

implement column reordering

fix column pos calculation

edit table column rendering config

verify filtering

make more tolerant to viewer hash

- Now selection is transient.

implement sorting

improve sorting
@kang-sw kang-sw force-pushed the feature/1-initial branch from be84cd4 to 39bc829 Compare March 5, 2024 08:54
rename instant command variants prefixed with cc

redefine UiActions

remove unnecessary unsafe logic

implement context menu popup

fix interactive validation

change sort order icon

improve selection stability

remove redundant local variable

improve context menu rendering

implement `Insert/RemoveRow` command

implement basic commands

verify row duplication/removal

improve visual stability when sorted

Tidy code

extract copy/cut event filtering

remove `hash` requirements from viewer

improve viewer state change detection

implement multiselect

tidy dup/del behavior

add several interfaces

implement cell duplication

implement internal clipboard past

fix editor position when sorted

implement SetCell command

remove `Clone` requirement from `R`

implement paste

verify drop reaction

rename `sheet` to `table
@kang-sw kang-sw force-pushed the feature/1-initial branch from cc89e7b to 1d5d580 Compare March 6, 2024 09:23
rename trait methods

change viewer return list of hotkeys

implement shortcut display

change default insertion policy

[wip] web publish

implement cell based editor

add hotkey display on demo

implement keyboard navigation
@kang-sw kang-sw force-pushed the feature/1-initial branch from 21d48e8 to 2228163 Compare March 6, 2024 12:44
@kang-sw kang-sw marked this pull request as ready for review March 6, 2024 12:44
@kang-sw kang-sw merged commit a74f815 into master Mar 6, 2024
@kang-sw kang-sw deleted the feature/1-initial branch May 11, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement: Initial features
1 participant