Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2d5dfa6
Add files via upload
taiebot Sep 12, 2026
0126cf0
Add files via upload
taiebot Sep 12, 2026
7076eec
Change layout mode from 'stacked' to 'cards'
taiebot Sep 12, 2026
7543443
Refactor ContextResourceCards to use NcTile component
taiebot Sep 13, 2026
38396c6
Refactor ContextResourceCards to use buttons
taiebot Sep 13, 2026
692e0b5
Refactor Context.vue layout mode handling
taiebot Sep 19, 2026
187420c
Implement dynamic minHeight for resource cards
taiebot Sep 19, 2026
aa4fa08
Refactor ContextResourceCards layout and styles
taiebot Sep 20, 2026
8aa1c29
Refactor resource display layout in Context.vue
taiebot Sep 20, 2026
57fb11f
Remove sticky positioning from ContextResourceCards
taiebot Sep 20, 2026
469ac36
Adjust card height and modify description styles
taiebot Sep 20, 2026
a22450a
Remove overflow-anchor property from resources__stack
taiebot Sep 20, 2026
c63366b
Add title row height measurement and cleanup
taiebot Sep 20, 2026
d96e398
Refactor Context.vue to remove titleRowHeight logic
taiebot Sep 21, 2026
99969f2
Refactor ContextResourceCards for better accessibility
taiebot Sep 21, 2026
93099fb
Refactor ContextResourceCards for detail view and accessibility
taiebot Sep 22, 2026
2a4e10c
Update import path for NcRichText component
taiebot Sep 22, 2026
cfedc10
Refactor SVG icons and enhance NcRichText component
taiebot Sep 22, 2026
1b59750
Replace SVG icons with text badges in ContextResourceCards
taiebot Sep 22, 2026
f286312
Adjust styles for info badge in ContextResourceCards
taiebot Sep 26, 2026
c4eec02
Replace badge spans with icon components
taiebot Sep 26, 2026
742268f
Refactor ContextResourceCards.vue to clean up code
taiebot Sep 26, 2026
7159006
Enhance styles for hover and element description
taiebot Sep 26, 2026
726a91a
Implement card view toggle in EditContext
taiebot Sep 27, 2026
cbcf815
Add card view toggle to CreateContext component
taiebot Sep 27, 2026
ed5ff9e
Clarify card view conditions in Context.vue
taiebot Sep 27, 2026
fb96cf0
Fix layoutMode return value for card view
taiebot Sep 27, 2026
8ac6814
Enhance focus styles for ContextResourceCards
taiebot Sep 27, 2026
c1e153b
Implement cards layout mode for resource display
taiebot Sep 27, 2026
3d74b3a
Refactor Context.vue for improved card layout handling
taiebot Sep 27, 2026
a63d4db
Replace NcActionCheckbox with NcActionCheckboxRadioSwitch
taiebot Sep 29, 2026
11e8c84
Replace NcActionCheckbox with NcActionCheckboxRadioSwitch
taiebot Sep 29, 2026
30f3305
Replace NcActionCheckboxRadioSwitch with NcCheckboxRadioSwitch
taiebot Sep 29, 2026
00d05c8
Replace NcActionCheckboxRadioSwitch with NcCheckboxRadioSwitch
taiebot Sep 29, 2026
b1eed82
Update NcCheckboxRadioSwitch event binding syntax
taiebot Sep 29, 2026
3db367f
Update event binding for NcCheckboxRadioSwitch components
taiebot Sep 29, 2026
0027ebe
Update navigation display mode logic
taiebot Sep 29, 2026
02559a4
Enhance display mode update for application sharing
taiebot Sep 30, 2026
e452b0b
Merge branch 'nextcloud:main' into Feat-App-card-layout
taiebot Sep 30, 2026
4a0d5a7
Add cardViewEnabled property and methods
taiebot Oct 1, 2026
20d50b4
Refactor display_mode assignment and add card_view_enabled
taiebot Oct 1, 2026
9a809f7
Add cardViewEnabled parameter to create and update methods
taiebot Oct 1, 2026
0e6ee32
Add cardViewEnabled parameter to create and update methods
taiebot Oct 1, 2026
ca49c8f
Add cardViewEnabled to ResponseDefinition type
taiebot Oct 1, 2026
1eac558
Add tests for card view enabled functionality
taiebot Oct 1, 2026
3aad29c
Add files via upload
taiebot Oct 1, 2026
65839e7
Merge branch 'nextcloud:main' into Feat-App-card-layout
taiebot Oct 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/Controller/ContextController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function show(int $contextId): DataResponse {
* @param string $iconName Material design icon name of the context
* @param string $description Descriptive text of the context
* @psalm-param list<array{id: int, type: int, permissions?: int}> $nodes optional nodes to be connected to this context
* @param bool $cardViewEnabled Show the resources of the context as cards instead of stacked
*
* @return DataResponse<Http::STATUS_OK, TablesContext, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN, array{message: string}, array{}>
*
Expand All @@ -108,7 +109,7 @@ public function show(int $contextId): DataResponse {
* 403: lacking permissions on a resource
*/
#[NoAdminRequired]
public function create(string $name, string $iconName, string $description = '', array $nodes = []): DataResponse {
public function create(string $name, string $iconName, string $description = '', array $nodes = [], bool $cardViewEnabled = false): DataResponse {
try {
if (!$this->isValidIcon($iconName)) {
return new DataResponse(['message' => 'Invalid icon name'], Http::STATUS_BAD_REQUEST);
Expand All @@ -120,6 +121,7 @@ public function create(string $name, string $iconName, string $description = '',
$this->sanitizeInputNodes($nodes),
$this->userId,
0,
$cardViewEnabled,
)->jsonSerialize());
} catch (Exception $e) {
return $this->handleError($e);
Expand All @@ -138,6 +140,7 @@ public function create(string $name, string $iconName, string $description = '',
* @param ?string $iconName provide this parameter to set a new icon
* @param ?string $description provide this parameter to set a new description
* @param ?array{id: int, type: int, permissions: int, order: int} $nodes provide this parameter to set a new list of nodes.
* @param ?bool $cardViewEnabled provide this parameter to show (or stop showing) the resources as cards
*
* @return DataResponse<Http::STATUS_OK, TablesContext, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND|Http::STATUS_FORBIDDEN|Http::STATUS_BAD_REQUEST, array{message: string}, array{}>
*
Expand All @@ -149,7 +152,7 @@ public function create(string $name, string $iconName, string $description = '',
* @CanManageContext
*/
#[NoAdminRequired]
public function update(int $contextId, ?string $name, ?string $iconName, ?string $description, ?array $nodes): DataResponse {
public function update(int $contextId, ?string $name, ?string $iconName, ?string $description, ?array $nodes, ?bool $cardViewEnabled = null): DataResponse {
try {
if ($iconName !== null && !$this->isValidIcon($iconName)) {
return new DataResponse(['message' => 'Invalid icon name'], Http::STATUS_BAD_REQUEST);
Expand All @@ -162,6 +165,7 @@ public function update(int $contextId, ?string $name, ?string $iconName, ?string
$iconName,
$description,
$nodes,
$cardViewEnabled,
)->jsonSerialize());
} catch (Exception|MultipleObjectsReturnedException $e) {
return $this->handleError($e);
Expand Down
7 changes: 6 additions & 1 deletion lib/Db/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @method setOwnerId(string $value): void
* @method getOwnerType(): int
* @method setOwnerType(int $value): void
* @method getCardViewEnabled(): ?bool
* @method setCardViewEnabled(?bool $value): void
*
* @method getSharing(): array
* @method setSharing(array $value): void
Expand All @@ -35,6 +37,7 @@ class Context extends EntitySuper implements JsonSerializable {
protected ?string $description = null;
protected ?string $ownerId = null;
protected ?int $ownerType = null;
protected ?bool $cardViewEnabled = null;

// virtual properties
protected ?array $sharing = null;
Expand All @@ -46,6 +49,7 @@ class Context extends EntitySuper implements JsonSerializable {
public function __construct() {
$this->addType('id', 'integer');
$this->addType('owner_type', 'integer');
$this->addType('cardViewEnabled', 'boolean');
}

public function jsonSerialize(): array {
Expand All @@ -56,7 +60,8 @@ public function jsonSerialize(): array {
'iconName' => $this->getIcon(),
'description' => $this->getDescription(),
'owner' => $this->getOwnerId(),
'ownerType' => $this->getOwnerType()
'ownerType' => $this->getOwnerType(),
'cardViewEnabled' => (bool)$this->getCardViewEnabled(),
];

// extended data
Expand Down
9 changes: 7 additions & 2 deletions lib/Db/ContextMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected function formatResultRows(array $rows, ?string $userId) {
'description' => $rows[0]['description'],
'owner_id' => $rows[0]['owner_id'],
'owner_type' => $rows[0]['owner_type'],
'card_view_enabled' => $rows[0]['card_view_enabled'] ?? null,
];

$formatted['sharing'] = array_reduce($rows, function (array $carry, array $item) use ($userId) {
Expand All @@ -103,7 +104,9 @@ protected function formatResultRows(array $rows, ?string $userId) {
'display_mode_default' => (int)$item['display_mode_default'],
];
if ($userId !== null) {
$item['display_mode'] ??= $item['display_mode_default'];
if ($item['display_mode'] === null) {
$item['display_mode'] = $item['display_mode_default'];
}
$carry[$item['share_id']]['display_mode'] = (int)$item['display_mode'];
}
return $carry;
Expand All @@ -128,7 +131,9 @@ protected function formatResultRows(array $rows, ?string $userId) {
// empty Context
return $carry;
}
$carry[$item['page_id']] ??= ['content' => []];
if (!isset($carry[$item['page_id']])) {
$carry[$item['page_id']] = ['content' => []];
}
$carry[$item['page_id']]['id'] = (int)$item['page_id'];
$carry[$item['page_id']]['page_type'] = $item['page_type'];
if ($item['node_rel_id'] !== null) {
Expand Down
42 changes: 42 additions & 0 deletions lib/Migration/Version2301Date20260930000000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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 Version2301Date20260930000000 extends SimpleMigrationStep {

#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if (!$schema->hasTable('tables_contexts_context')) {
return null;
}

$contexts = $schema->getTable('tables_contexts_context');

if (!$contexts->hasColumn('card_view_enabled')) {
$contexts->addColumn('card_view_enabled', Types::BOOLEAN, [
'notnull' => false,
'default' => false,
'comment' => 'Show the application resources as cards instead of stacked',
]);
}

return $schema;
}
}
1 change: 1 addition & 0 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
* description: string,
* owner: string,
* ownerType: int,
* cardViewEnabled: bool,
* }
*
* @psalm-type TablesContextNavigation = array{
Expand Down
8 changes: 6 additions & 2 deletions lib/Service/ContextService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ public function findById(int $id, ?string $userId): Context {
* @psalm-param list<array{id: int, type: int, permissions?: int, order?: int}> $nodes
* @throws Exception|PermissionError|InvalidArgumentException
*/
public function create(string $name, string $iconName, string $description, array $nodes, string $ownerId, int $ownerType): Context {
public function create(string $name, string $iconName, string $description, array $nodes, string $ownerId, int $ownerType, bool $cardViewEnabled = false): Context {
$context = new Context();
$context->setName(trim($name));
$context->setIcon(trim($iconName));
$context->setDescription(trim($description));
$context->setOwnerId($ownerId);
$context->setOwnerType($ownerType);
$context->setCardViewEnabled($cardViewEnabled);

$this->atomic(function () use ($context, $nodes): void {
$this->contextMapper->insert($context);
Expand All @@ -159,7 +160,7 @@ public function create(string $name, string $iconName, string $description, arra
* @throws DoesNotExistException
* @throws PermissionError|MultipleObjectsReturnedException
*/
public function update(int $contextId, string $userId, ?string $name, ?string $iconName, ?string $description, ?array $nodes): Context {
public function update(int $contextId, string $userId, ?string $name, ?string $iconName, ?string $description, ?array $nodes, ?bool $cardViewEnabled = null): Context {
$context = $this->contextMapper->findById($contextId, $userId);

if ($name !== null) {
Expand All @@ -171,6 +172,9 @@ public function update(int $contextId, string $userId, ?string $name, ?string $i
if ($description !== null) {
$context->setDescription(trim($description));
}
if ($cardViewEnabled !== null) {
$context->setCardViewEnabled($cardViewEnabled);
}

$hasUpdatedNodeInformation = false;
if ($nodes !== null) {
Expand Down
Loading
Loading