-
Notifications
You must be signed in to change notification settings - Fork 43
🖼️ Add persistent per-view layout modes (table / tiles / gallery) #2407
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
Open
Rello
wants to merge
29
commits into
main
Choose a base branch
from
codex/implement-persistent-layout-modes-in-nextcloud-tables
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
01d9619
Add persistent per-view layouts
Rello 19fa7e5
Fix layout review feedback
Rello 23edbaf
Refactor value assignment for JsonSerializable
Rello aea4c66
Refactor layout options to use a table format
Rello 0cb66de
Add dynamic class binding for card layout
Rello 38accd4
Refactor CustomTable layout and URL generation
Rello 7a8eec8
Update styles for custom table in NcTable.vue
Rello 76a0cdb
Merge branch 'main' into codex/implement-persistent-layout-modes-in-n…
Rello 28fbeed
Delete tests/unit/Db/ViewLayoutTest.php
Rello 76fc76d
Delete cypress/e2e/view.cy.js
Rello eb8dc8d
Merge branch 'main' into codex/implement-persistent-layout-modes-in-n…
Rello 966c79f
update doc
Rello 99e0bc7
Add layout property with enum options to openapi.ts
Rello 8bb97f0
Add 'layout' property to OpenAPI schema
Rello e962941
Change layout type to string or null
Rello de58e69
Add files via upload
Rello 8df9e93
Enhance layout property documentation
Rello 97f12ed
Add files via upload
Rello 24339c8
Add files via upload
Rello 5c9000d
Add files via upload
Rello 3ec1e87
Add files via upload
Rello 4887356
Add files via upload
Rello 9403893
Add files via upload
Rello 0ccebd1
Add files via upload
Rello 2ad4739
Add files via upload
Rello d57edf7
Add files via upload
Rello 55ed950
Add files via upload
Rello 0bf453d
Add files via upload
Rello c079712
Add files via upload
Rello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Tables\Migration; | ||
|
|
||
| use Closure; | ||
| use OCP\DB\ISchemaWrapper; | ||
| use OCP\DB\Types; | ||
| use OCP\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
| use Override; | ||
|
|
||
| class Version1000Date20260318000000 extends SimpleMigrationStep { | ||
|
|
||
| #[Override] | ||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
| /** @var ISchemaWrapper $schema */ | ||
| $schema = $schemaClosure(); | ||
| $tableName = 'tables_views'; | ||
| if (!$schema->hasTable($tableName)) { | ||
| return null; | ||
| } | ||
|
|
||
| $table = $schema->getTable($tableName); | ||
| if (!$table->hasColumn('layout')) { | ||
| $table->addColumn('layout', Types::STRING, [ | ||
| 'notnull' => false, | ||
| 'length' => 16, | ||
| ]); | ||
| } | ||
| if (!$table->hasColumn('card_background_source')) { | ||
| $table->addColumn('card_background_source', Types::INTEGER, [ | ||
| 'notnull' => false, | ||
| 'unsigned' => false, | ||
| ]); | ||
| } | ||
| if (!$table->hasColumn('card_title_source')) { | ||
| $table->addColumn('card_title_source', Types::INTEGER, [ | ||
| 'notnull' => false, | ||
| 'unsigned' => false, | ||
| ]); | ||
| } | ||
|
|
||
| return $schema; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rello
I’m planning to introduce a Kanban layout, which will also require additional columns. This led me to consider an alternative approach: instead of continuously adding new dedicated columns for each feature, we could introduce a single settings column (stored as JSON text).
This settings field would encapsulate various configuration attributes, allowing us to store extensible metadata without inflating the schema.
I see this as a more scalable and maintainable solution, as it avoids excessive schema growth and simplifies future migrations.
Example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
thats a good idea. But I would keep the dedicated layout column for performance. there, your kanban would then also go in. but to derive the pure layout of a view (where table might be the standard) it would be overhead to parse the settings json every time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi.
Are you planning to replace the card_background_source and card_title_source columns with a single settings (JSON) column, or should I try to push that change into your PR?